Add a benchmark for symbol-to-proc

Calculating -------------------------------------
               block      5403 i/100ms
              &:to_s      6094 i/100ms
-------------------------------------------------
               block    60023.4 (±5.3%) i/s -     302568 in   5.055537s
              &:to_s    59047.0 (±4.9%) i/s -     298606 in   5.068991s
This commit is contained in:
Parker Moore 2014-10-22 01:17:22 -07:00
parent 4e07dfef1f
commit 7e37892bbd
1 changed files with 6 additions and 0 deletions

6
benchmark/symbol-to-proc Normal file
View File

@ -0,0 +1,6 @@
require 'benchmark/ips'
Benchmark.ips do |x|
x.report('block') { (1..100).map { |i| i.to_s } }
x.report('&:to_s') { (1..100).map(&:to_s) }
end