Sha256: b0f55093bf003fdeabd88283400b9c2c77ac3dac74786bf3dca1c8e27edcb3e9
Contents?: true
Size: 310 Bytes
Versions: 13
Compression:
Stored size: 310 Bytes
Contents
# frozen_string_literal: true require 'benchmark/ips' STRING_HASH = { "foo" => "bar" } SYMBOL_HASH = { :foo => "bar" } Benchmark.ips do |x| x.report("string") { STRING_HASH["foo"] } x.report("symbol") { SYMBOL_HASH[:foo] } x.report("symbol-from-string") { SYMBOL_HASH["foo".to_sym] } x.compare! end
Version data entries
13 entries across 13 versions & 1 rubygems