Skip to content

Instantly share code, notes, and snippets.

@phortx
Created February 25, 2014 07:21
Show Gist options
  • Save phortx/9204330 to your computer and use it in GitHub Desktop.
Save phortx/9204330 to your computer and use it in GitHub Desktop.
Ruby 2.1.1 benchmark

Used https://github.com/dakull/ruby-simple-benchmarks/ for benchmarking

Ruby 2.1.0

> ruby --version
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]

> time ruby bm_gc_mb.rb 
       user     system      total        real
   0.200000   0.010000   0.210000 (  0.208676)
   0.300000   0.020000   0.320000 (  0.323699)
   1.000000   0.070000   1.070000 (  1.064552)
ruby bm_gc_mb.rb  1,56s user 0,14s system 88% cpu 1,918 total

> time ruby bm_gc_string.rb 
       user     system      total        real
   3.360000   0.090000   3.450000 (  3.455224)
   7.250000   0.040000   7.290000 (  7.297208)
  10.130000   0.030000  10.160000 ( 10.156744)
ruby bm_gc_string.rb  20,78s user 0,19s system 99% cpu 20,979 total

> time ruby for_vs_each.rb 
       user     system      total        real
   0.290000   0.000000   0.290000 (  0.287766)
   0.260000   0.000000   0.260000 (  0.256716)
ruby for_vs_each.rb  0,60s user 0,00s system 78% cpu 0,766 total

> time ruby good_to_know.rb 
       user     system      total        real
   0.060000   0.000000   0.060000 (  0.067809)
   0.250000   0.010000   0.260000 (  0.246962)
ruby good_to_know.rb  0,36s user 0,01s system 99% cpu 0,369 total

Ruby 2.1.1

> ruby --version                
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]

> time ruby bm_gc_mb.rb 
       user     system      total        real
   0.180000   0.030000   0.210000 (  0.205150)
   0.310000   0.000000   0.310000 (  0.312566)
   1.010000   0.040000   1.050000 (  1.057199)
ruby bm_gc_mb.rb  1,57s user 0,11s system 99% cpu 1,674 total

> time ruby bm_gc_string.rb 
       user     system      total        real
   3.510000   0.050000   3.560000 (  3.574144)
   7.010000   0.090000   7.100000 (  7.099202)
  10.950000   0.050000  11.000000 ( 11.001718)
ruby bm_gc_string.rb  21,53s user 0,22s system 99% cpu 21,751 total

> time ruby for_vs_each.rb 
       user     system      total        real
   0.270000   0.000000   0.270000 (  0.268384)
   0.260000   0.000000   0.260000 (  0.256476)
ruby for_vs_each.rb  0,58s user 0,00s system 99% cpu 0,585 total

> time ruby good_to_know.rb 
       user     system      total        real
   0.060000   0.000000   0.060000 (  0.064042)
   0.250000   0.010000   0.260000 (  0.246753)
ruby good_to_know.rb  0,36s user 0,01s system 99% cpu 0,370 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment