Skip to main content

Profiling your development environment

Posted by fabriziogiudici on May 30, 2007 at 9:37 AM PDT

When your application becomes large, and it starts requiring a non-neglectable compilation time, it's high time you profiled your environment.

Now, compiling blueMarine on my MacBook Pro requires more than 2 minutes, so I started thinking about tuning the environment. As usual, tuning starts with a measurement. Now, I have to say I believe my MacBook Pro has some problem: sometimes it sits down (also when using other applications) so I think I have to clean up the o.s. installation (hoping that there are no problems in the hardware). So I ran my first tests on the Mac Mini, which has cleaner installations. The tests were run in each of the three operating systems it supports (multiple boot, no virtualization) in the same conditions (NetBeans 5.5, Ant 1.6.5, no other applications running in background, ant clean build run on the same build of blueMarine). Tests were run 10 times each, and the results are the average of each batch (with a couple of out-of-average samples discarded).

Here are the preliminary results:

o.s. build with NetBeans build with Ant
Mac OS X 1'40" 1'44"
Linux Ubuntu 7.04 1'06" 1'02"
Windows XP 3'10" 1'40"

Now, what jumps to eyes is the whopping performance of Linux compared to Windows and (sigh) Mac OS X. Since the difference is also shown when using command line tools (i.e. no fancy graphics that might depend on a lot of things), the only explanation I have is about the efficiency of the filesystem, that should be the bottleneck when compiling a project made of almost 800 source files. While I can't say I'm not disappointed, I'm not too surprised of the poor performance of Mac OS X, as I think that its HFS is somewhat old. Leopard should deliver the flashy ZFS and things will go better in a few months.

For what concerns the terrible 3'10" with Windows and NetBeans, I think is due to the inefficient use of memory by Windows: the Mac Mini is equipped with only 1GB of RAM, while similar tests run on machines with 2GB didn't show relevant difference with the ant times.

I'd like to hear if somebody else measured this stuff and had the same experience.

PS I'm not expert in this kind of stuff, but I was wondering: sources and libraries fits in about 200MB. On a machine with 2GB RAM, wouldn't it make sense to preload them in RAM? Of course at this point I'd also espect a new version of javac taking advantage of multi-core computers...

PS2 I bet that Felipe will comment soon... ;-)