Skip to content

Instantly share code, notes, and snippets.

@mrkn
Created March 23, 2016 23:39
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 mrkn/2a1f41e9000be0f5d32f to your computer and use it in GitHub Desktop.
Save mrkn/2a1f41e9000be0f5d32f to your computer and use it in GitHub Desktop.
$ ./ruby -v -rbenchmark -e 'Benchmark.bmbm() {|x| x.report("even?") { 100_000_000.times { 1.even? } } }
'
ruby 2.4.0dev (2016-03-18 trunk 54163) [x86_64-darwin15]
Rehearsal -----------------------------------------
even? 5.470000 0.020000 5.490000 ( 5.525505)
-------------------------------- total: 5.490000sec
user system total real
even? 5.590000 0.020000 5.610000 ( 5.668936)
$ ./ruby -v -rbenchmark -e 'Benchmark.bmbm() {|x| x.report("even?") { 100_000_000.times { 1.even? } } }'
ruby 2.4.0dev (2016-03-18 trunk 54164) [x86_64-darwin15]
Rehearsal -----------------------------------------
even? 10.510000 0.040000 10.550000 ( 10.630255)
------------------------------- total: 10.550000sec
user system total real
even? 9.780000 0.020000 9.800000 ( 9.848424)
$ ./ruby -v -rbenchmark -e 'Benchmark.bmbm() {|x| x.report("even?") { 100_000_000.times { 1.even? } } }'
ruby 2.4.0dev (2016-03-18 trunk 54165) [x86_64-darwin15]
Rehearsal -----------------------------------------
even? 5.950000 0.050000 6.000000 ( 6.145201)
-------------------------------- total: 6.000000sec
user system total real
even? 6.690000 0.170000 6.860000 ( 7.945961)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment