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:
parent
4e07dfef1f
commit
7e37892bbd
|
@ -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
|
Loading…
Reference in New Issue