tags:

views:

483

answers:

4

I am working on a large (100s of assemblies) asp.net application and during development it can take a couple of minutes for the first page to load after a recompile.

I am told that much of the delay comes from JITing the assemblies and that this delay is proportional to the number (but not the size) of assemblies. I have not yet measured this.

We are working on architectural changes to improve the situation (combine assemblies, decouple applications) but I was wondering if there are any quick hit fixes that I can get by, for example, changing IIS settings in development or combining DLLs post-build.

We are using .net 3.5.

Any suggestions for me?

+2  A: 

Take a look into pre-compiling the apps to remove the JIT.

ngen

Precompile the assemblies you are not working on, create custom build configurations that don't build the assemblies you aren't working on, and then only the ones you need will JIT.

Tom Anderson
+2  A: 

I worked on a project similar to yours with tons of assemblies. One strategy I employed was to only load the assemblies I needed for the development I was currently working on.

Another possibility is to merge all your assemblies with a post build action. Microsoft has this nifty tool called ILMerge. It merges multiple assemblies into one. You could write a post build script to merge these assemblies together.

You could also take this a step further by merging the assemblies you are not changing and add them as references.

Best of Luck!

Chuck Conway
A: 

You could look at NGEN'ing your assemblies but if you are trying to speed up development time after the build then NGEN isn't really going to help you much. The time it takes to JIT your code would all be up-front with NGEN as you will have to create native instructions for everything just to test. If anything, NGEN'ing your code would be slower up front.

Andrew Hare
not if you ngen the assemblies you aren't working on and don't build them while developing, they will stay pre-compiled and you can just work in a smaller sandbox.
Tom Anderson
Yes - that's what I am planning to do now. I'll let you know how it goes.
Kevin Lawrence
Tom - good point - I assumed he was rebuilding everything each time.
Andrew Hare
+1  A: 

sheepish

Here's a solution that I should've tried earlier: Disabling virus protection reduces the initial load time from about a minute to less than 8 seconds.

Kevin Lawrence