Improving The Performance of Liferay's Ant-Based Build System

In recent days, some of the engineers at Liferay reported some amazing performance gains with Liferay's Ant build system by using Linux instead of Windows. Well this peaked my curiosity to say the least. I've been working exclusively with Windows XP on my desktop since around 2001, and have only used with Linux on servers -- never for my desktop. Well I'm a former Solaris / IRIX / DecUnix / HP-UX guy and so I decided to give Linux a try on the desktop.

I tried Fedora 7 first, but received a "too many open files" error when I tried to compile Liferay Portal with the "ant all" command. I tried messing with the limits.conf file but still wasn't able to get it working.

So I tried Ubuntu and I didn't receive the "too many open files" error. Woo hoo! BTW, I've got the Nvidia XGL driver going along with the Compiz Fusion window manager. Liferay developer James Min wasn’t kidding when he wrote to me “OS X, Vista... Watch out!” COMPIZ FUSION IS TOTALLY OUT OF CONTROL WAY COOL!!! Check out this movie to see for yourself. I’ve got the desktop cube thing working between Remote Desktop to Windows and Linux. I'm loving it! (On a semi-related side note, the IntelliJ IDEA user interface has a limitation where you can only open one project at a time. With virtual desktops, I might be able to work-around this limitation by having an IntelliJ project open on each virtual desktop.)

Well back to the Ant build system performance issue... Here are my unscientific test results -- not sorted, just grouped according to hardware:

Test# Machine Hard Disk OS JDK Compiler Build Time
1 Pentium M 1.8 Ghz 7200RPM Windows XP Sun JDK 1.4 Jikes 8 minutes, 30 seconds
2 Pentium M 1.8 Ghz 7200RPM Windows XP Sun JDK 5.0 Jikes 3 minutes, 52 seconds
Note that by changing JDK from 1.4 to 5.0 made the build
go more than 2x faster on Windows XP
3 Pentium M 1.8 Ghz 7200RPM 32-bit Ubuntu 7.04 Sun JDK 1.4 Jikes 2 minutes, 54 seconds
4 Pentium M 1.8 Ghz 7200RPM 32-bit Ubuntu 7.04 Sun JDK 5.0 Jikes 2 minutes, 7 seconds
Note that the change from JDK 1.4 to 5.0 on Ubuntu made the build
go 1.5x faster (which is significant), but less-so than on WinXP
5 Intel Core 2 Duo T7800 2.6Ghz 7200RPM 32-bit Windows Vista Sun JDK 5.0 ECJ 6 minutes, 22 seconds
6 Intel Core 2 Duo T7800 2.6Ghz 7200RPM 32-bit Windows Vista Sun JDK 5.0 Jikes 4 minutes, 38 seconds
7 Intel Core 2 Duo T7800 2.6Ghz 7200RPM 32-bit Windows Vista Sun JDK 6.0 Jikes > 11 minutes!
Note that the performance disaster here *may* have something to do with some
kind of incompatibility Java 6 and Ant. That's my best guess, anyhow.
8 Intel Core 2 Duo T7600 2.4Ghz 7200RPM 64-bit Ubuntu 7.10 Sun JDK 5.0 Jikes 2 minutes, 23 seconds
9 Intel Core 2 Duo T7600 2.4Ghz 7200RPM 64-bit Ubuntu 7.10 Sun JDK 5.0 ECJ 3 minutes, 35 seconds

Conclusions for Fastest Performance:

  • Use JDK 5.0 and not 1.4 or 6.0 due to performance problems
  • Use Linux instead of Windows
    • 32-bit Linux is somehow a little faster than 64-bit Linux. Puzzling? (compare test#4 and #8). this leads me to believe that the only remaining bottleneck is the speed of the disk -- so we have to wait for bigger solid-state drives I guess
  • Use Jikes instead of ECJ
    • Note that Jikes doesn't support some of the new language features of JDK 5.0. Liferay source is based on JDK 1.4 so compiling with Jikes should be fine until we start taking advantage of some of these new language features

 

BTW, Many thanks to Michael Young for showing us all how to make the ECJ compiler work with Ant to build Liferay. Copying the ejc.jar file to Ant’s “lib” folder did the trick for me. See: LEP-4273

Blogs
Hey, have you other Linux guys tried either suspend to disk or suspend to ram with the 3D desktop turned on? I wind up with a borked desktop if I do that. Trying to determine if it's my distro's config or what.... :-)
Yeah, I've had no luck suspending with compiz running. I've tried adding my video card's driver to the list of modules to stop when suspending but still no luck. Most of the time I'm able to recover by jumping to another tty and killing the compiz process or ssh into it from another machine but sometimes it just kills the box completely.
I can't take all the credit for evangelizing Linux, that goes to Ray Auge. I saw him using Ubuntu on a daily basis and followed suit.

Glad you found something that works for you. =)
Well I'm not totally weaned off Windows yet. I'm still using Outlook for email, and Trillian for IM. Not sure that I will ever be able to live without Windows, but I can use my desktop cube to switch to an rdesktop when I need to!