1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/benchmark/hash_first.yml
tompng (tomoya ishida) 9f9045123e
st.c: skip all deleted entries [Bug #17779]
Update the start entry skipping all already deleted entries.
Fixes performance issue of `Hash#first` in a certain case.
2021-04-11 19:05:26 +09:00

11 lines
233 B
YAML

prelude: |
hash1 = 1_000_000.times.to_h { [rand, true]}
hash2 = hash1.dup
hash2.keys[1..100_000].each { hash2.delete _1 }
hash2.delete hash2.first[0]
benchmark:
hash1: hash1.first
hash2: hash2.first
loop_count: 100_000