I’ve been experimenting with using Nailgun to speed up rake tasks, to
make
developing a Rails app on JRuby a little more pleasant. But the odd
thing
is, Nailgun actually seems to be slower at most tasks than just running
Java:
(First run is to warm up the nailgun):
$ time jruby --ng -S rake environment
real 0m18.704s
user 0m0.010s
sys 0m0.023s
And then after that:
$ time jruby --ng -S rake environment
real 0m12.418s
user 0m0.010s
sys 0m0.024s
$ time jruby -S rake environment
real 0m8.788s
user 0m8.951s
sys 0m0.605s
The operating system is OS X Snow Leopard:
$ uname -mrsv
Darwin 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST
2009; root:xnu-1486.2.11~1/RELEASE_I386 i386
$ java -version -d32 -server
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
Java HotSpot(TM) Server VM (build 14.1-b02-90, mixed mode)
The only bit of oddness in my setup that I can think of is that I’m
running
the JVM in 32-bit mode, with ‘JAVA_OPTS=-d32 -server’. If I pull this
out,
go to a 64-bit JVM, and warm up Nailgun, here’s what I get:
$ java -version
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode)
$ time jruby -S rake environment
real 0m13.618s
user 0m20.729s
sys 0m1.108s
$ time jruby --ng -S rake environment
real 0m11.550s
user 0m0.010s
sys 0m0.024s
This is pretty much the opposite of my experience with running JRuby
apps
with the ‘-d32’ option, so I’m curious what I’m missing. Any ideas as
to
what I’m doing wrong?