Skip to content

Instantly share code, notes, and snippets.

@inokappa
Last active August 29, 2018 11:54
Show Gist options
  • Select an option

  • Save inokappa/360cc285d24f0902a11b1d44c90ac30f to your computer and use it in GitHub Desktop.

Select an option

Save inokappa/360cc285d24f0902a11b1d44c90ac30f to your computer and use it in GitHub Desktop.
JRuby で awspec を動かすぞ (awspec 自体のテスト実行時間を計測する)

JRuby で awspec を動かすぞ (awspec 自体のテスト実行時間を計測する)

実験の目的

JRuby でも awspec が動くのは分かったけど, JVM の起動に引きづられているようで処理時間が CRuby で実行するよりも長くなってしまう. これを少しでも短縮する方法を検討する.

実験環境

$ java --version
java 10.0.2 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

$ jruby --version
jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 Java HotSpot(TM) 64-Bit Server VM 10.0.2+13 on 10.0.2+13 +jit [darwin-x86_64]

$ ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

実験結果

# CRuby
$ bundle exec rake spec:subnet
........

Finished in 0.07609 seconds (files took 2.63 seconds to load)
8 examples, 0 failures

# JRuby
$ bundle exec rake spec:subnet
........

Finished in 0.56038 seconds (files took 10.03 seconds to load)
8 examples, 0 failures

$ JRUBY_OPTS='--dev -G' bundle exec rake spec:subnet
........

Finished in 0.33188 seconds (files took 5.93 seconds to load)
8 examples, 0 failures

# JRuby Nailgun 利用
$ JRUBY_OPTS='--dev -G' jruby -S --ng bundle exec rake spec:subnet

(別の端末に出力される)
........

Finished in 0.21025 seconds (files took 6.08 seconds to load)
8 examples, 0 failures

$ jruby -S --ng bundle exec rake spec:subnet

(別の端末に出力される)
........

Finished in 0.59495 seconds (files took 8.46 seconds to load)
8 examples, 0 failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment