CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

James Kovacs


NHibernate versus Ultimate Developer Rig - Kovacs Edition

Today I decided to contribute some patches to the upcoming NHibernate 2.0 release. First order of business was to get latest and then run:

nant clean build > output-debug-build.log

which compiles NHibernate and the unit tests. Unfortunately something went horribly wrong as the build finished early. Usually nant chews on a large project like NHibernate for awhile and then spits out something like this near the bottom of the output:

BUILD SUCCEEDED

Total time: 57.5 seconds.

I started splunking through the output to try to figure out what was wrong and noticed this at the bottom of the output:

BUILD SUCCEEDED

Total time: 11.9 seconds.

About 12 seconds to compile everything! I'm used to a quick return from nant usually meaning a failed compile. Not in this case. The Ultimate Developer Rig - Kovacs Edition is just plain fast. And that made me happy.

CORRECTION: The above NAnt command builds the unit tests, but doesn't actually run them. Mea culpa.

UPDATE: I ran everything again including running the unit tests:

nant clean build test > output-debug-build.log

On my Latitude D820 (Core Duo 2.0 GHz), total time was 98.6 seconds.

On the Ultimate Developer Rig - Kovacs Edition, total time was 62.8 seconds.

Yes, unit tests - especially for NHibernate where you really have to touch the database for most tests - take time to run. Note that a really fast box doesn't help unit test times as the unit tests take about 40 seconds to run regardless. This says to me that unit test times are dominated by the time spent communicating with the local SQL Server database.

N.B. NAnt does not support parallel builds. So only one core was kept busy. You can hack MSBuild to support parallel builds as documented by Scott Hanselman. Given the fact that most developers have at least dual if not quad-proc machines, I hope that build tools start officially supporting parallel builds.


Published Jun 06 2008, 05:33 PM by james.kovacs
Filed under:

Comments

Eric Holton said:

Automated Build Studio does support parallel bulids (http://www.automatedqa.com)

# June 6, 2008 8:48 PM

Brett Veenstra said:

Care to share your Ultimate Developer rig specs?

# June 8, 2008 1:00 AM

james.kovacs said:

The specs and reasoning behind various choices was in my previous post, which I should have linked to:

codebetter.com/.../ultimate-developer-rig-kovacs-edition.aspx

# June 8, 2008 3:23 PM

Stephen Rylander said:

My old dell is really fast when it doesn't have to actually run the unit tests too!  Unit tests take a long time!  

# June 9, 2008 4:13 PM

james.kovacs said:

@Stephen - I felt pretty silly when I realized that the unit tests weren't run. I'm still happy that compile time went from 58 seconds to 12 seconds. Unit testing an OR/M is time-consuming because most tests have to touch the database, which is slow even if it's a local one.

# June 9, 2008 5:25 PM

Stephen Rylander said:

@James: Yes, that is a huge gain!  We have a very large solution that takes a long time to compile let along run unit tests.  

# June 10, 2008 9:20 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About james.kovacs

James Kovacs is an independent architect, developer, trainer, and jack-of-all-trades, specializing in agile development using the .NET Framework. He is passionate about helping developers create flexible software using test-driven development (TDD), unit testing, object-relational mapping, dependency injection, refactoring, continuous integration, and related techniques. He is a founding member of the Plumbers @ Work podcast, which is syndicated by MSDN Canada Community Radio. His article, “Debug Leaky Apps: Identify And Prevent Memory Leaks In Managed Code”, appeared in the January 2007 issue of MSDN Magazine. James is a Microsoft Most Valuable Professional (MVP) - Solutions Architect and card-carrying member of ALT.NET, a group of software professionals continually looking for more effective ways to develop applications. He received his Masters degree from Harvard University. Check out Devlicio.us!

Our Sponsors

Free Tech Publications