Solving the performance issue 

Saturday, October 03, 2009 6:35:59 AM

One of the biggest problems about Ivonna is its performance. On medium sites, the first request to a page can take up to several minutes. The following requests are quite fast, however, which makes Ivonna more efficient than client-side tools when running big integration suites. However, doing the fast red-green-refactor cycles is.. not as fast as it should be.

After some investigation, I discovered that the the Asp.Net engine recompiles the web site when it receives the first request. Even if the site itself hasn't changed. A few more hours of digging (with the help of the excellent CThru's TraceAspect) revealed the whole picture:

  1. When the runtime creates a new AppDomain for the site, it recalculates the hash and compares it to the previous value.
  2. Since the test assembly has changed (even if it hasn't, since it's been copied to the bin folder, the timestamp has changed), the hash is different.
  3. The runtime clears the temp directory.
  4. On first request, it recompiles the site.

There are two tricks that can help us here. The first is pretty sraightforward: install a RAM drive and point the temp directory there:

<compilation debug="true" strict="false" explicit="true" tempDirectory="R:\temp"

The second is more esoteric: in the compilation tag, put  optimizeCompilations="true". This will skip checking the bin (as well as App_Code and resources) folder for modifications. So, sometimes you'd want to recompile -- you can do that by touching one of the aspx pages.



5 + 9 =