Skip to content

Instantly share code, notes, and snippets.

@headius
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/9551563 to your computer and use it in GitHub Desktop.
Save headius/9551563 to your computer and use it in GitHub Desktop.
$ rvm ruby-2.1 do ruby -e "def foo(a); self; end; 10.times { t = Time.now; i = 0; while i < 10_000_000; foo(a: 1, b: 2, c: 3); i+=1; end; puts Time.now - t }"
6.850559
6.785051
6.857232
6.761483
6.942781
6.735549
6.705151
6.95679
7.296288
6.782784
$ jruby -e "def foo(a); self; end; 10.times { t = Time.now; i = 0; while i < 10_000_000; foo(a: 1, b: 2, c: 3); i+=1; end; puts Time.now - t }"
1.424
1.061
1.004
1.011
1.045
1.114
1.132
1.023
0.996
1.05
$ ../rubinius/bin/rbx -e "def foo(a); self; end; 10.times { t = Time.now; i = 0; while i < 10_000_000; foo(a: 1, b: 2, c: 3); i+=1; end; puts Time.now - t }"
9.309882
7.30408
7.348192
7.331358
7.343608
^C
system ~/projects/jruby $ rvm ruby-2.1 do ruby -e "def foo(a, b, c); self; end; 10.times { t = Time.now; i = 0; while i < 10_000_000; foo(1, 2, 3); i+=1; end; puts Time.now - t }"
0.666222
0.668974
0.642629
0.664634
0.650078
0.638872
0.650223
0.671685
0.668169
0.636404
system ~/projects/jruby $ jruby -e "def foo(a, b, c); self; end; 10.times { t = Time.now; i = 0; while i < 10_000_000; foo(1, 2, 3); i+=1; end; puts Time.now - t }"
0.387
0.125
0.136
0.14
0.136
0.136
0.125
0.124
0.14
0.125
system ~/projects/jruby $ ../rubinius/bin/rbx -e "def foo(a, b, c); self; end; 10.times { t = Time.now; i = 0; while i < 10_000_000; foo(1, 2, 3); i+=1; end; puts Time.now - t }"
0.707525
0.058092
0.058159999999999996
0.06344899999999999
0.058231
0.058778
0.059224
0.057949
0.05895500000000009
0.061613999999999995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment