summaryrefslogtreecommitdiff
path: root/benchmark/bm_hash_ident_obj.rb
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/bm_hash_ident_obj.rb')
-rw-r--r--benchmark/bm_hash_ident_obj.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/benchmark/bm_hash_ident_obj.rb b/benchmark/bm_hash_ident_obj.rb
new file mode 100644
index 0000000..4b3b58e
--- /dev/null
+++ b/benchmark/bm_hash_ident_obj.rb
@@ -0,0 +1,4 @@
+h = {}.compare_by_identity
+objs = 26.times.map { Object.new }
+objs.each { |o| h[o] = o }
+200_000.times { objs.each { |o| h[o] } }