From 7e37892bbdf7192d9c4b9217f74fd9a8cf938299 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 22 Oct 2014 01:17:22 -0700 Subject: [PATCH] Add a benchmark for symbol-to-proc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- benchmark/symbol-to-proc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 benchmark/symbol-to-proc diff --git a/benchmark/symbol-to-proc b/benchmark/symbol-to-proc new file mode 100644 index 00000000..bc08b2f2 --- /dev/null +++ b/benchmark/symbol-to-proc @@ -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