3 ms·
Basic Ruby 2.0 benchmarks calculating pi from gist [1] $ ruby --version ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin12.2.1] $ time ruby pidigits
by ScotterC 14y ago
Basic Ruby 2.0 benchmarks calculating pi from gist [1]
$ 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
17.51s user 0.11s system 99% cpu 17.639 total
$ 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
4.64s user 0.27s system 99% cpu 4.927 total
That's a significant difference in speed. Going from 17.51 seconds to 4.64 seconds
1. https://gist.github.com/thoughtpolice/5025417 https://gist.github.com/thoughtpolice/5025417
- mrgordon 14y agoIf we see these sorts of improvements overall, then this is a very exciting update
- mixonic 14y agoI've also seen a speedup in Rails app boot time (the require optimizations): 1.9.3-p194: 11.8s 1.9.3-p385: 9.9s 2.0.0-rc2: 6.1s! Tests were done with `time bundle exec rake environment` 5 times, dropping the highest and lowest and getting the mean of the rest (lazy snow day benchmarking). Very exciting!
- ko1 14y agoThank you for trying. What script `pidigits.rb' do you use?
- draegtun 14y agoMost likely it was this script: http://benchmarksgame.alioth.debian.org/u32/program.php?test=pidigits&lang=yarv&id=3 http://benchmarksgame.alioth.debian.org/u32/program.php?test...
- josephlord 14y agoNot tried 2.0 yet but got very significant speedup of 1.93 (about 3x) when I enabled optimisation in the build. Were the build settings similar for both versions in your tests?