public
Created

Ruby benchmarks

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
$ rbenv versions
system
1.9.3-p385
* 2.0.0-p0 (set by RBENV_VERSION environment variable)
jruby-1.7.3
$ rbenv shell system
$ rbenv which ruby
/usr/bin/ruby
$ ruby --version
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
$ time ruby pidigits.rb 10000 2>&1 > /dev/null
ruby pidigits.rb 10000 2>&1 > /dev/null 35.20s user 0.20s system 99% cpu 35.422 total
$ rbenv shell 1.9.3-p385
$ rbenv which ruby
/Users/a/.rbenv/versions/1.9.3-p385/bin/ruby
$ ruby --version
ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin12.2.1]
$ time ruby pidigits.rb 10000 2>&1 > /dev/null
ruby pidigits.rb 10000 2>&1 > /dev/null 17.51s user 0.11s system 99% cpu 17.639 total
$ rbenv shell jruby-1.7.3
$ rbenv which ruby
/Users/a/.rbenv/versions/jruby-1.7.3/bin/ruby
$ ruby --version
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_10-b18 [darwin-x86_64]
$ time ruby pidigits.rb 10000 2>&1 > /dev/null
ruby pidigits.rb 10000 2>&1 > /dev/null 9.43s user 0.23s system 121% cpu 7.959 total
$ rbenv shell 2.0.0-p0
$ rbenv which ruby
/Users/a/.rbenv/versions/2.0.0-p0/bin/ruby
$ ruby --version
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1]
$ time ruby pidigits.rb 10000 2>&1 > /dev/null
ruby pidigits.rb 10000 2>&1 > /dev/null 4.64s user 0.27s system 99% cpu 4.927 total

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.