by ScotterC · 13y ago · 0 comments
$ 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.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!