The Source for Java Technology Collaboration
User: Password:



Fabrizio Giudici

Fabrizio Giudici's Blog

Profiling your development environment

Posted by fabriziogiudici on May 30, 2007 at 09:37 AM | Comments (13)

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 NetBeansbuild with Ant
Mac OS X1'40"1'44"
Linux Ubuntu 7.041'06"1'02"
Windows XP3'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... ;-)


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Any way you could profile the system on OpenSolaris as well? Would be interesting to see the results of that.

    Posted by: olsonje on May 30, 2007 at 10:42 AM

  • This is a problem... there's no room on the Mac Mini for another operating system. On the contrary, there is a 8GB free partition on the MacBook Pro, which was to be used for OpenSolaris, but I couldn't terminate the installation yet :-( The installation app just crashes.

    Posted by: fabriziogiudici on May 30, 2007 at 10:49 AM

  • Anyway someone with an OpenSolaris install could run the test for you? I have a box with it, but I don't know what your compiling or if it's something I can get to try?

    Posted by: olsonje on May 30, 2007 at 10:55 AM

  • Yes, it is possible and relatively easy. The sources can be checked out with:

    svn co https://bluemarine.dev.java.net/svn/bluemarine/trunk/src -r 2032 --username guest

    NetBeans 5.5.1 must be installed with Java 1.5.0, and the project must be opened with it. Then there's a menu "Clean and build main project".

    After the try with NetBeans, ant can be tried with

    ant clean build
    

    (note that you must open the project with NetBeans once before being able to run ant from the command line). This version has some more stuff than the one I tested and takes a few more seconds than the reported data, anyway I can re-run my tests.

    If you need some more details, contact me (also directly by email: fabrizio dot giudici at tidalwave dot it),

    Posted by: fabriziogiudici on May 30, 2007 at 11:33 AM

  • Will do, will be a several hours until I can get home and try this.

    Posted by: olsonje on May 30, 2007 at 12:10 PM

  • Ok. Probably I won't be able to connect until tomorrow evening, my local time. See you later.

    Posted by: fabriziogiudici on May 30, 2007 at 01:15 PM

  • At work we have about 10k files, about 5.5k of them are .java. We use GNU make to build, either in linux or in windows/cygwin. The windows build take a lot longer.

    One thing that you want to do is to tell the file system to not do atime updates, this feature is available for both windows and unix file systems and it makes a big difference.

    When we were on java/1.4 we used to build with jikes, it was usually about 3-4 times as fast as javac so if you are not using any of the java/5 features then try jikes as well.

    Posted by: ernimril on May 30, 2007 at 02:37 PM

  • Regarding PS : For building in RAM, on MacOS X try Esperance DV (http://www.mparrot.net/downloads/esperance_dv.zip). Create a RAMDisk, and copy/move your workspace there so you don't get slowed down by hard drive.

    Posted by: kopepi on May 30, 2007 at 04:28 PM

  • ernimril:
    How do you disable atime on windows?

    Posted by: keeskuip on May 31, 2007 at 11:40 AM

  • @kopepi: you gave an excellent suggestion! I've just run a quick test on the MacBook Pro, Esperance brings the compilation time down from 2'25" to 1'20" (now, these times are not comparable with the ones in the table - I'll re-run a batch of coherent tests).

    Posted by: fabriziogiudici on May 31, 2007 at 12:03 PM

  • Since I do not do windows myself I am not sure what we use at work to disable atime on windows/ntfs, but a quick google gives at least two easy ways: http://www.pctools.com/guides/registry/detail/50/ and http://www.windowsdevcenter.com/pub/a/windows/2005/02/08/NTFS_Hacks.html

    Posted by: ernimril on May 31, 2007 at 02:02 PM

  • Anybody can tell us how to do the same on Linux and Mac OS X? :-)

    Posted by: fabriziogiudici on May 31, 2007 at 02:07 PM

  • We got about 112 MB of sources and jars + some xml in there. Eclipse is our main IDE and my colleague who works in windows has about x2 build time compared to my Linux installation. Dell laptop, 1.5 Gig ram Pentium M 1.8 GHz (single core)

    Posted by: francisdb on June 05, 2007 at 02:05 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds