Skip to content

Instantly share code, notes, and snippets.

@headius
Created November 5, 2011 14:09
Show Gist options
  • Select an option

  • Save headius/1341547 to your computer and use it in GitHub Desktop.

Select an option

Save headius/1341547 to your computer and use it in GitHub Desktop.
redblack tree impl perf on JRuby (OpenJDK 6, 7, HEAD) and Ruby 1.9.3p0
# Flags passed to JRuby are to enable fastest options for that JVM version
# JAVA 6
system ~/projects/redblack $ pickjdk 1
New JDK: 1.6.0.jdk
system ~/projects/redblack $ jruby -X+C bm1.rb 10
2.577
1.758
1.761
1.76
1.743
1.769
1.729
1.732
1.742
1.736
# JAVA 7 (FCSish)
system ~/projects/redblack $ pickjdk 3
New JDK: 1.7.0.jdk
system ~/projects/redblack $ jruby -X+C -Xinvokedynamic.invocation.switchpoint=false bm1.rb 10
3.745
1.814
1.709
2.404
1.571
1.571
1.638
1.588
1.598
1.577
# OpenJDK HEAD
system ~/projects/redblack $ pickjdk 5
New JDK: 1.8.0.jdk
system ~/projects/redblack $ jruby -X+C -Xinvokedynamic.all=true bm1.rb 10
7.872
2.777
1.583
3.458
0.932
0.826
0.923
0.814
0.93
0.824
# Ruby 1.9.3p0
ruby-1.9.3-p0 ~/projects/redblack $ ruby -I. bm1.rb 3
3.135914
GC.count = 7
3.121792
GC.count = 10
3.141376
GC.count = 13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment