Permalink
Browse files

Try to use nailgun for jRuby build to speed things up.

  • Loading branch information...
1 parent cd96e6e commit e9b65a13fa9a24230a2127731f7dfb0942f6323c @myronmarston myronmarston committed Sep 18, 2011
Showing with 23 additions and 1 deletion.
  1. +1 −1 features/support/env.rb
  2. +11 −0 script/jruby_build.sh
  3. +11 −0 script/shutdown_jruby_nailgun.rb
View
@@ -20,7 +20,7 @@
set_env('RUBYOPT', '-I../../lib -rubygems')
# 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('JRUBY_OPTS', '-X-C --ng') # disable JIT since these processes are so short lived
set_env('JAVA_OPTS', '-d32') # force jRuby to use client JVM for faster startup times
end
end
View
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+# start up a JRuby nailgun server (and ensure it shuts down on exit)
+ruby --ng-server > /dev/null 2>&1 &
+trap "script/shutdown_jruby_nailgun.rb" EXIT
+
+bundle exec cucumber
+# bundle install
+# bundle exec rake cucumber
+# bundle exec cucumber --profile wip
+
@@ -0,0 +1,11 @@
+#!/usr/bin/env ruby
+
+possible_processes = `ps -o pid,command | grep jruby | grep [N]GServer`.split("\n")
+
+if possible_processes.size == 1
+ pid = possible_processes.first.strip.split(/\s+/).first.to_i
+ Process.kill(9, pid)
+else
+ raise "Did not find 1 process as expected. Found:\n#{possible_processes.join("\n")}"
+end
+

0 comments on commit e9b65a1

Please sign in to comment.