Skip to content

Instantly share code, notes, and snippets.

@headius
Created March 18, 2010 02:24
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/335979 to your computer and use it in GitHub Desktop.
Save headius/335979 to your computer and use it in GitHub Desktop.
~/projects/jruby ➔ ../jruby-1.3.1/bin/jruby --server -rjava -rbenchmark -e "a = java.util.ArrayList.new; 100000.times { a << java.lang.Object.new }; 5.times { puts Benchmark.measure { a.each { |x| x } } }"
0.768000 0.000000 0.768000 ( 0.716000)
0.328000 0.000000 0.328000 ( 0.328000)
0.240000 0.000000 0.240000 ( 0.241000)
0.239000 0.000000 0.239000 ( 0.239000)
0.254000 0.000000 0.254000 ( 0.254000)
~/projects/jruby ➔ ../jruby-1.4.0/bin/jruby --server -rjava -rbenchmark -e "a = java.util.ArrayList.new; 100000.times { a << java.lang.Object.new }; 5.times { puts Benchmark.measure { a.each { |x| x } } }"
0.803000 0.000000 0.803000 ( 0.748000)
0.226000 0.000000 0.226000 ( 0.226000)
0.224000 0.000000 0.224000 ( 0.224000)
0.209000 0.000000 0.209000 ( 0.209000)
0.211000 0.000000 0.211000 ( 0.211000)
~/projects/jruby ➔ bin/jruby --server -rjava -rbenchmark -e "a = java.util.ArrayList.new; 100000.times { a << java.lang.Object.new }; 5.times { puts Benchmark.measure { a.each { |x| x } } }" 0.721000 0.000000 0.721000 ( 0.680000)
0.240000 0.000000 0.240000 ( 0.240000)
0.166000 0.000000 0.166000 ( 0.166000)
0.166000 0.000000 0.166000 ( 0.166000)
0.191000 0.000000 0.191000 ( 0.191000)
~/projects/jruby ➔ bin/jruby -J-Djruby.ji.objectProxyCache=false --server -rjava -rbenchmark -e "a = java.util.ArrayList.new; 100000.times { a << java.lang.Object.new }; 5.times { puts Benchmark.measure { a.each { |x| x } } }"
0.533000 0.000000 0.533000 ( 0.483000)
0.138000 0.000000 0.138000 ( 0.138000)
0.080000 0.000000 0.080000 ( 0.080000)
0.081000 0.000000 0.081000 ( 0.081000)
0.072000 0.000000 0.072000 ( 0.073000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment