views:

156

answers:

1

We have a couple of large solutions, each with about 40 individual projects (class libraries and nested websites). It takes about 2 minutes to do a full rebuild all.

A couple of specs on the system:

  • Visual Studio 2005, C#
  • Primary project is a Web Application Project
  • 40 projects in total (4 Web projects)
  • We use the internal VS webserver
  • We extensively use user controls, right down to a user control which contains a textbox
  • We have a couple of inline web projects that allows us to do partial deployment
  • About 120 user controls
  • About 200.000 lines of code (incl. HTML)
  • We use Source Safe

What I would like to know is how to bring down the time it takes when hitting the site with a browser for the first time. And, I'm not talking about post full deployment - I'm talking about doing a small change in the code, build, refresh browser.

This first hit, takes about 1 minute 15 seconds before data gets back.

To speed things up, I have experimented a little with Ram disks, specifically changing the <compilation> attribute in web.config, setting the tempDirectory to my Ram disk. This does speed things up a bit. Interestingly though, this totally removed ALL IO access during first hit from the browser.

Remarks
We never do a full compile during development, only partial. For example, the class library being worked on is compiled and then the main site is compiled which then copies the binaries from the class library to the bin directory.

I understand that the asp.net engine needs to parse all the ascx/aspx files after critical files have been changed (bin dir for example) but, what I don't understand is why it needs to do that when only one library dll has been modified.

So, anybody know of a way to either: Sub segment the solutions to provide faster first hit or fine tune settings in config files or something.

And, again: I'm only talking about development, NOT production deployment, so doing the pre-built compile option is not applicable.

Thanks, Ruvan

+2  A: 

Wow, 120 user controls, some of which only contain a single TextBox? This sounds like a lot of code.

When you change a library project, all projects that depend on that library project then need to be recompiled, and also every project that depends on them, etc, all the way up the stack. You know you've only made a 1 line change to a function which doesn't affect all of your user controls, but the compiler doesn't know that.

And as you're probably aware ASPX and ASCX files are only compiled when the web application is first hit.

A possible speed omprovement might be gained by changing your ASCX files into Composite Controls instead, inside another Library Project. These would then be compiled at compile time (if you will) rather than at web application load time.

samjudson