summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-10 09:22:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-10 09:22:37 +0000
commita56b0f8b29b3be1323ebfde50cab94808ac65375 (patch)
tree58617f53b8c050543560db5a974c8b1deab3b66e /benchmark
parentb935a13ba559a6993f6fcbdcc1096ef6b2d41b02 (diff)
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
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/bm_hash_to_proc.rb9
1 files changed, 9 insertions, 0 deletions
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