Permalink
Browse files

Tweak some JRuby/Java settings to run the cukes faster.

On my mac book pro this made them about twice as fast.

Before these changes, `time bundle exec cucumber` resulted in:
  bundle exec cucumber  2644.08s user 214.31s system 225% cpu 21:09.29 total

After these changes, `time bundle exec cucumber` resulted in:
  bundle exec cucumber  732.46s user 115.82s system 136% cpu 10:22.37 total
  • Loading branch information...
1 parent 355f727 commit 1592c942e0d0bd30127e3b8cf89194fe6fd118d6 @myronmarston myronmarston committed Dec 1, 2011
Showing with 9 additions and 1 deletion.
  1. +1 −0 .travis.yml
  2. +8 −1 features/support/env.rb
View
@@ -5,3 +5,4 @@ rvm:
- 1.9.2
- 1.9.3
- ree
+ - jruby
View
@@ -1,5 +1,12 @@
require 'aruba/cucumber'
Before do
- RUBY_PLATFORM =~ /java/ ? @aruba_timeout_seconds = 60 : @aruba_timeout_seconds = 5
+ if RUBY_PLATFORM =~ /java/
+ # ideas taken from: http://blog.headius.com/2010/03/jruby-startup-time-tips.html
+ set_env('JRUBY_OPTS', '-X-C') # disable JIT since these processes are so short lived
+ set_env('JAVA_OPTS', '-d32') # force jRuby to use client JVM for faster startup times
+ @aruba_timeout_seconds = 60
+ else
+ @aruba_timeout_seconds = 5
+ end
end

0 comments on commit 1592c94

Please sign in to comment.