From a56b0f8b29b3be1323ebfde50cab94808ac65375 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 10 Nov 2015 09:22:37 +0000 Subject: [PATCH] bm_hash_to_proc.rb * benchmark/bm_hash_to_proc.rb: benchmark for Hash#to_proc. [Feature #11653] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/bm_hash_to_proc.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 benchmark/bm_hash_to_proc.rb diff --git a/benchmark/bm_hash_to_proc.rb b/benchmark/bm_hash_to_proc.rb new file mode 100644 index 0000000000..2b675bf509 --- /dev/null +++ b/benchmark/bm_hash_to_proc.rb @@ -0,0 +1,9 @@ +h = {} + +10000.times do |i| + h[i] = nil +end + +5000.times do |i| + [i].map(&h) +end