summaryrefslogtreecommitdiff
path: root/benchmark/hash_aref_sym.yml
blob: e289d4aff30218028e067432fb8a048c000fad85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
benchmark:
  hash_aref_sym: |
    h = {}
    syms = ('a'..'z').to_a
    begin
      syms = eval("%i[#{syms.join(' ')}]")
    rescue SyntaxError # <= 1.9.3
      syms.map!(&:to_sym)
    end
    syms.each { |s| h[s] = s }
    200_000.times { syms.each { |s| h[s] } }
loop_count: 1