views:

1433

answers:

3

We have a pretty big ASP.NET WebForm (web application) project with a lot of references to other libraries, other projects etc and most of the time after a compilation, the first time we load a page it takes a LONG time before rendering anything... Disk IO is the main problem. For small projects it's nearly instantaneous, but once your project gets large, it can really slow development and remove fun from programming.

My question: Does first page load time after a compilation is has slow in ASP.NET MVC as it is in ASP.NET Webforms for big projects?

Thanks,

+2  A: 

MVC still uses the same ASP.NET framework as Web Forms, so you are probably going to see similar behavior, regardless.

The long first load time is because your project's build output is still just IL code that needs to be compiled into native code by the JIT compiler before executing. Any code changes that you make will cause the previously cached native code for your app to be discarded, so the JIT has to recompile. Naturally, the larger your project, the longer it's going to take for the JIT to process it.

Jeromy Irvine
+1  A: 

You will see similar load times in both environments.

In both environments, if your site gets large you should pre-compile your site before deployment. This will eliminate the performance drag on first page load.

Stephen M. Redd
He's talking about during development.
Todd Smith
+1  A: 

There are a lot of things thhat can be done to improve performance, the enhancements in order to provide for a separation of concerns in MVC apps can help a lot. Though the default view engine re-uses webforms, Views have a far simpler control stack than typical webforms, which helps a lot, not to even mention alternative view engines.

the hit for 'first view' comes from having to JIT a large set of classes/objects that are used in your project and it's first page.

Tracker1