Last active
December 15, 2015 20:40
Revisions
-
fbernier revised this gist
Apr 5, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 @@ -1,7 +1,7 @@ require "benchmark/ips" Benchmark.ips do |x| x.report("double quote assignment:") {a = "yo man"} x.report("double quote +:") {|i| a = "yo man" + i.to_s} x.report("double quote <<:") {|i| a = "yo man" << i.to_s} x.report("double quote interpolation:") {|i| a = "yo man #{i}"} -
fbernier created this gist
Apr 5, 2013 .There are no files selected for viewing
This file contains hidden or 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,12 @@ require "benchmark/ips" Benchmark.ips do |x| x.report("doublequote assignment:") {a = "yo man"} x.report("double quote +:") {|i| a = "yo man" + i.to_s} x.report("double quote <<:") {|i| a = "yo man" << i.to_s} x.report("double quote interpolation:") {|i| a = "yo man #{i}"} x.report("single quote assignment:") {a = 'yo man'} x.report("single quote +:") {|i| a = 'yo man' + i.to_s} x.report("single quote <<:") {|i| a = 'yo man' << i.to_s} end