Revisions
-
tenderlove revised this gist
Nov 21, 2013 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,9 +22,10 @@ def self.x end __END__ [aaron@higgins git]$ ruby -v gistfile1.rb ruby 2.1.0dev (2013-11-16 trunk 43688) [x86_64-darwin12.5.0] user system total real constant 0.870000 0.000000 0.870000 ( 0.878663) literal 1.210000 0.000000 1.210000 ( 1.206898) frozen 0.510000 0.000000 0.510000 ( 0.509119) [aaron@higgins git]$ -
tenderlove revised this gist
Nov 21, 2013 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,10 +18,13 @@ def self.x Benchmark.bm do |x| x.report("constant") { TIMES.times { ::M::N::A::B.x }} x.report("literal") { TIMES.times { '' }} x.report("frozen") { TIMES.times { ''.freeze }} end __END__ [aaron@higgins git]$ ruby gistfile1.rb user system total real constant 0.890000 0.000000 0.890000 ( 0.892681) literal 1.200000 0.000000 1.200000 ( 1.202642) frozen 0.520000 0.000000 0.520000 ( 0.516941) [aaron@higgins git]$ -
fxn revised this gist
Nov 20, 2013 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,10 @@ def self.x Benchmark.bm do |x| x.report("constant") { TIMES.times { ::M::N::A::B.x }} x.report("literal") { TIMES.times { '' }} end __END__ fxn@yeager:~/tmp $ ruby foo.rb user system total real constant 0.970000 0.000000 0.970000 ( 0.974618) literal 1.170000 0.010000 1.180000 ( 1.173427) -
fxn created this gist
Nov 20, 2013 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ require 'benchmark' TIMES = 10_000_000 module M X = '' module N module A module B def self.x X end end end end end Benchmark.bm do |x| x.report("constant") { TIMES.times { ::M::N::A::B.x }} x.report("literal") { TIMES.times { '' }} end