Improving ASP.NET Compile Time

Very useful article here: http://blog.lavablast.com/post/2010/12/01/Slash-your-ASPNET-compileload-time.aspx

The biggest and easiest win is tweaking the System.Web.Compilation section of your web.config:

  • Setting the batch attribute to false (mean each page class is compiled when a request hits it, if batch is on, this compilation is … batched). In effect you choose between many small performance hits (unbatched) or one big hit (batched) – and for the usual “change – build – test” cycle of web dev – you want the first.
  • Setting optimizeCompilations to true will allow you to deploy an updated binary to the websites bin folder (for example if you have built your BLL or DLL project) without triggering a full recompile – this is very useful if you’re working with e.g. CMS platforms where you might copy your bespoke code into the main platform website.
    For Web Projects this also applies to changes to the app_code (but really, stay away from web projects).
  • Setting up a RAM Disk and pointing the tempdirectory attribute to this can also improve compile times.

Interesting feature (for very large projects) is parallel builds: http://www.hanselman.com/blog/HackParallelMSBuildsFromWithinTheVisualStudioIDE.aspx

Finally – another main factor is apparently buying a better PC!

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: