views:

66

answers:

2

The Difference between an ASP.NET Website and ASP.NET Web Application has been asked many times. However, I couldn't find an answer to my question as to whether there is any real performance difference in using one over the other. Further, it is my understanding that a website project is dynamically compiled; does that means every time a request compiles the requested page?

+1  A: 

For an asp.net website the pages are compiled dynamically as needed. AKA - the first time they are accessed or when they change.

I think the performance difference is minor/not at all different after compile between the two solutions. The two solutions are designed for different needs/desires.

By being dynamically compiled you can put a new code behind file on the server and it will recognize the new file and recompile when the next person accesses it. This gives flexibility in updating your site.

However, a web application has many advantages over a website. See this blog post for and this one for a nice comparison of the two.

klabranche
+2  A: 

Let's make assumptions here and anyone who made actual tests can add their two cents.

Application start speed difference

Website start:

  • Website has less code to compile => faster
  • Website has to compile + JIT compile => double work

Web application start:

  • Only has to JIT compile => single work
  • Has to compile the whole assembly (or several of them for that matter) => slower, since there's more code to compile

Running application speed difference

When all pages of a website have been accessed, there shouldn't be any speed difference any more. No compiles happen and code just runs. In this regard, both type of Asp.net apps are the same.

Code changes differentiation

Website:

  • changing a particular file slows things down just for that particular file, because it has to compile + JIT compile it again

Webapplication:

  • any change means recompiling the whole assembly, which means more JIT compiling on the server.
Robert Koritnik