Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: JRuby 1.4
-
Fix Version/s: None
-
Component/s: Performance
-
Labels:None
-
Number of attachments :
Description
This is an important metric for test-driven development. It's difficult to get into a flow with a minimum 5-10 second overhead on every test run.
In a fresh rails app:
$ time rake environment
(in /Users/john_firebaugh/Development/test2)
real 0m1.033s
user 0m0.848s
sys 0m0.154s
$ time jrake environment
(in /Users/john_firebaugh/Development/test2)
real 0m8.340s
user 0m12.506s
sys 0m0.717s
Nailgun helps, but not enough to make test-driven development pleasant.
$ time jruby --ng -S rake environment
(in /Users/john_firebaugh/Development/test2)
real 0m5.243s
user 0m0.011s
sys 0m0.023s
For real-world app with significant custom initialization code, the difference is even greater, and nailgun less helpful:
$ time jrake environment
(in /Users/john_firebaugh/Development/SCM)
real 0m14.107s
user 0m18.855s
sys 0m1.038s
$ time jruby --ng -S rake environment
(in /Users/john_firebaugh/Development/SCM)
real 0m12.584s
user 0m0.011s
sys 0m0.023s
$ jruby -v
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-04 6586) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_15) [x86_64-java]
Lots of good info in Charles's blog post:
http://blog.headius.com/2010/03/jruby-startup-time-tips.html
Here are my timings:
$ jruby -v
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-04 6586) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_15) [x86_64-java]
$ jruby -J-d32 -v
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-04 6586) (Java HotSpot(TM) Client VM 1.6.0_17) [i386-java]
$ time jruby -S rake environment > /dev/null
real 0m14.367s
user 0m19.897s
sys 0m0.998s
$ time jruby -J-d32 -S rake environment > /dev/null
real 0m7.791s
user 0m8.599s
sys 0m0.513s
All variants involving nailgun (--ng-server with and without -J-d32, --ng with and without -J-d32) were slower than that.