Skip to content

Instantly share code, notes, and snippets.

@nahi
Created January 13, 2012 23:20
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 nahi/1609310 to your computer and use it in GitHub Desktop.
Save nahi/1609310 to your computer and use it in GitHub Desktop.
Free performance boost from JRuby!
Bear in mind that Rubinius is not tuned yet after hydra (GIL free branch) merge I believe.
% ruby -v -Ilib bench/bench.rb
ruby 2.0.0dev (2012-01-14 trunk 34297) [x86_64-linux]
Rehearsal ----------------------------------------------------
Hash aset 0.090000 0.000000 0.090000 ( 0.096379)
Hash aref 0.050000 0.000000 0.050000 ( 0.045496)
Hash delete 0.080000 0.000000 0.080000 ( 0.078845)
RadixTree aset 1.400000 0.020000 1.420000 ( 1.425785)
RadixTree aref 1.380000 0.010000 1.390000 ( 1.382887)
RadixTree delete 1.350000 0.000000 1.350000 ( 1.348760)
AVLTree aset 1.630000 0.000000 1.630000 ( 1.633743)
AVLTree aref 0.520000 0.000000 0.520000 ( 0.518722)
AVLTree delete 1.810000 0.000000 1.810000 ( 1.816441)
------------------------------------------- total: 8.340000sec
user system total real
Hash aset 0.050000 0.000000 0.050000 ( 0.052377)
Hash aref 0.050000 0.000000 0.050000 ( 0.044540)
Hash delete 0.070000 0.000000 0.070000 ( 0.073773)
RadixTree aset 1.350000 0.010000 1.360000 ( 1.358899)
RadixTree aref 1.090000 0.000000 1.090000 ( 1.096310)
RadixTree delete 1.150000 0.000000 1.150000 ( 1.151931)
AVLTree aset 1.550000 0.000000 1.550000 ( 1.551093)
AVLTree aref 0.510000 0.000000 0.510000 ( 0.509444)
AVLTree delete 1.740000 0.000000 1.740000 ( 1.737126)
% jruby -v -Ilib bench/bench.rb
jruby 1.7.0.dev (ruby-1.8.7-p357) (2012-01-12 694e204) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_04-ea) [linux-amd64-java]
Rehearsal ----------------------------------------------------
Hash aset 0.189000 0.000000 0.189000 ( 0.190000)
Hash aref 0.092000 0.000000 0.092000 ( 0.092000)
Hash delete 0.068000 0.000000 0.068000 ( 0.068000)
RadixTree aset 2.502000 0.000000 2.502000 ( 2.503000)
RadixTree aref 1.062000 0.000000 1.062000 ( 1.062000)
RadixTree delete 1.337000 0.000000 1.337000 ( 1.337000)
AVLTree aset 1.807000 0.000000 1.807000 ( 1.807000)
AVLTree aref 0.489000 0.000000 0.489000 ( 0.489000)
AVLTree delete 2.429000 0.000000 2.429000 ( 2.429000)
------------------------------------------- total: 9.975000sec
user system total real
Hash aset 0.057000 0.000000 0.057000 ( 0.057000)
Hash aref 0.055000 0.000000 0.055000 ( 0.055000)
Hash delete 0.069000 0.000000 0.069000 ( 0.069000)
RadixTree aset 1.033000 0.000000 1.033000 ( 1.033000)
RadixTree aref 0.732000 0.000000 0.732000 ( 0.732000)
RadixTree delete 1.391000 0.000000 1.391000 ( 1.391000)
AVLTree aset 1.222000 0.000000 1.222000 ( 1.222000)
AVLTree aref 0.442000 0.000000 0.442000 ( 0.442000)
AVLTree delete 1.212000 0.000000 1.212000 ( 1.212000)
% rbx -v -Ilib bench/bench.rb
rubinius 2.0.0dev (1.8.7 fc528bd2 yyyy-mm-dd JI) [x86_64-unknown-linux-gnu]
Rehearsal ----------------------------------------------------
Hash aset 0.768048 0.020001 0.788049 ( 0.886629)
Hash aref 0.068004 0.000000 0.068004 ( 0.071102)
Hash delete 0.112007 0.004000 0.116007 ( 0.117814)
RadixTree aset 2.520158 0.012001 2.532159 ( 2.814606)
RadixTree aref 1.204075 0.004000 1.208075 ( 1.287779)
RadixTree delete 1.432090 0.008001 1.440091 ( 1.686493)
AVLTree aset 1.776111 0.024001 1.800112 ( 1.923831)
AVLTree aref 0.632040 0.000000 0.632040 ( 0.632228)
AVLTree delete 3.764235 0.004001 3.768236 ( 3.940461)
------------------------------------------ total: 12.352773sec
user system total real
Hash aset 0.444028 0.000000 0.444028 ( 0.441447)
Hash aref 0.068004 0.000000 0.068004 ( 0.067156)
Hash delete 0.064004 0.000000 0.064004 ( 0.070501)
RadixTree aset 2.332145 0.004000 2.336145 ( 2.347067)
RadixTree aref 1.152072 0.012001 1.164073 ( 1.206530)
RadixTree delete 1.384086 0.000000 1.384086 ( 1.396242)
AVLTree aset 1.620101 0.004000 1.624101 ( 1.635080)
AVLTree aref 0.540034 0.012001 0.552035 ( 0.573676)
AVLTree delete 3.636227 0.052003 3.688230 ( 3.711294)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment