VOOZH about

URL: http://rvm.io/set/benchmark

⇱ RVM: Ruby Version Manager - Benchmarking with RVM


👁 RVM Logo
Support
RVM is maintained by community of volunteers, report issues to RVM issues tracker.
If you can help or wish to become one of the maintainers - just start helping. You can find more RVM related projects at RVM Github organization.
Donation
Love RVM? Help us maintain RVM, a donation can help with it. Want to help in other way, want to be a sponsor?
contact: Michal Papis
Sponsors
👁 Fastly
Carbon Ads
Documentation  >  Set  >  Benchmark

Benchmarking with RVM

If you have a bit of code that you would like to benchmark across several versions of ruby all at once you can now do this easily with RVM. Given:

$ cat increment.rb
require 'benchmark'

puts RUBY_DESCRIPTION
puts Benchmark.measure do
 y=0
 1000.times do |x|
 y = x + 1
 end
end

We can benchmark this code against multiple ruby versions very easily:

$ rvm 1.8.6,1.8.7,1.9.1,ree do ruby increment.rb

ruby-1.8.6-p383: ruby 1.8.6 (2009-08-04 patchlevel 383) [i686-darwin10.0.0]

Rehearsal ---------------------------------------------------------------
benchmarking 'increment.rb' 0.000000 0.000000 0.000000 ( 0.000261)
\------------------------------------------------------ total: 0.000000sec

user system total real
benchmarking 'increment.rb' 0.000000 0.000000 0.000000 ( 0.000263)

ruby-1.8.7-p174: ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0]

Rehearsal ---------------------------------------------------------------
benchmarking 'increment.rb' 0.000000 0.000000 0.000000 ( 0.001448)
\------------------------------------------------------ total: 0.000000sec

user system total real
benchmarking 'increment.rb' 0.000000 0.000000 0.000000 ( 0.001364)

ruby-1.9.1-p243: ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10.0.0]

Rehearsal ---------------------------------------------------------------
benchmarking 'increment.rb' 0.000000 0.000000 0.000000 ( 0.000096)
\------------------------------------------------------ total: 0.000000sec

user system total real
benchmarking 'increment.rb' 0.000000 0.000000 0.000000 ( 0.000090)

ruby-enterprise-1.8.6-20090610: ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin10.0.0]
Ruby Enterprise Edition 20090610

Rehearsal ---------------------------------------------------------------
benchmarking 'increment.rb' 0.000000 0.000000 0.000000 ( 0.000281)
\------------------------------------------------------ total: 0.000000sec

user system total real
benchmarking 'increment.rb' 0.000000 0.000000 0.000000 ( 0.000272)

Notes

RVM Documentation Index | RVM Blog
RVM Interpreters Rubies
Gemsets Set Actions Workflow Deployment
Integration
Packages Presentations Help & Support Quality Assurance Development Credits
∞ Copyright © 2009-2011 Wayne E. Seguin © 2011-2017 Michal Papis © 2016-2017 Piotr Kuczynski ∞ Built with Nanoc ∞ Cached by Fastly ∞ Tested by Travis CI