How to figure out why my local host site takes so long to load?

后端 未结 8 1990
逝去的感伤
逝去的感伤 2021-01-05 02:54

I noticed today and yesterday that running my site on local host is very slow. I highly doubt this is a code issue as when I put it up on my live site it went fast.

相关标签:
8条回答
  • 2021-01-05 03:06

    Not alot to go on here, but if you have a javascript intensive application, and you are debugging using I/E as your default browser, then the IDE does need to load that javascript into the debugger. I might recommend using Firebug's profiling tool or YSlow to see what files are are the culprit.

    Also, (and this may or may not be relevant to your problem), I found a similar situation whereby some of our pages never fully load and seem to hangup on the last resource the browser wants to get. However, hitting refresh, the page loads without a hitch. It is sporadic and causes grief when doing selenium web tests. I believe it may be IIS related.

    0 讨论(0)
  • 2021-01-05 03:10

    What Browser are you debugging with?

    I had similar issues running my site in FireFox 3+ (Win7).

    This was resolved by going into about:config if FireFox and setting network.dns.disableIPv6 to true.

    0 讨论(0)
  • 2021-01-05 03:12

    You kind of answered your own question.

    A page on local host debug mode(F5) takes 44 seconds

    Debug mode creates debug info, pdb files in other words. The resulting DLL also contains symbolic links to these debug info symbols. The size of DLL is bigger. In other words, it has to do a lot more and hence the time. Also, code is not optimized for performance.

    If your local webserver hasn't started, then it will take additional time to spin that up, load assemblies, perform JIT and show your app.

    The same page on local host but not in debug mode(ctrl + F5) takes 4 seconds

    This time it was built without debug info, so significantly less overhead. Probably your webserver was started at this point which further reduced the time.

    The same page on my live site takes 2 seconds

    Finally, your live site most likely will have the release version of code (without debug info). And most likely, the server will have much more horsepower (CPU/RAM/Cache) than your local PC. Hence the speed improvement.

    Irrespective of where you deploy, there will always be a lag on the first hit due to JIT compilation. Your live site, after an IISReset will show this lag too (unless you're using IIS7 and have a warm up module).

    Hope this helps!

    0 讨论(0)
  • 2021-01-05 03:12

    My site load time in debug mode went down from 3 minutes to 35 seconds when I set the Debug for "x86" in place of "Any CPU" in Visual Studio 2015. This is done by simply choosing "x86" from the DropDown in the visual studio toolbar.

    I hope this helps someone.

    0 讨论(0)
  • 2021-01-05 03:17

    This is a stab in the dark as a developer I know had similar problem.

    We edited the global.asax file in our project and it seemed to clear out some corrupted assemblies. I suggest you try clear out the GAC of compiled dlls for your app (you'll have to google for location)

    0 讨论(0)
  • 2021-01-05 03:22

    Just in case anyone else finds this one. I had a similar problem. Very slow to load even basic html pages.

    It was AVG Antivirus.

    0 讨论(0)
提交回复
热议问题