views:

142

answers:

1

I have been using DotNetBlogEngine for many years, and today my host (JodoHost.com) officially turned on support for .NET 4.0. I had them change my site from a 2.0 application to a 4.0 application and planned on recompiling the site if I had to. What I've noticed immediately is that the website loads tremendously faster on the first load, subsequent loads are only slightly faster.

The website is compiled as a .NET 2.0 web application, there was no need for a recompile of the site.

Is there a known reason for this performance increase? Was there a change in the .NET 4.0 framework that improved the initial load time of websites into an application pool?

This is hosted on a 2003 server.

Here is the site for reference: http://www.ocdprogrammer.com

+6  A: 

Probably doesn't explain a huge speedup, but please see: .NET 4 Web Application Startup Time:

... there's a switch in C:\Windows\Microsoft.NET\Framework\v4.0.xxxx\Aspnet.config called shadowCopyVerifyByTimestamp that ASP.NET uses to startup up the CLR. The CLR optimized in .NET 4 how shadow copy assemblies are loaded by removing an unnecessary file copy if nothing's changed. Hence, part of the improvement in cold web app startup.

Mitch Wheat
Very interesting Mitch. Curious to see if anybody else has something to offer on this. As I am seeing much better than 10% improvement.
Clarence Klopfstein
But according to that, the difference is like 200ms for blogengine, which doesn't really explain "tremendously faster". I think it's hard to know in general, for example, his host might've also upgraded the server his blog is hosted on at the same time, for example... or maybe the server hosting .NET 4 apps only has a couple of websites whereas the one with .NET 2.0 has heaps, etc...
Dean Harding
No upgrades to the server, just an install of the .NET 4.0 framework. Though I wonder if it is still a load issue, in that I am likely one of just a few .NET 4.0 people where the .NET 2.0 load was greater.
Clarence Klopfstein
Gave you the answer, as it makes some sense.
Clarence Klopfstein