Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (13 sloc) 232 Bytes
require 'rubygems'
require 'rbench'
TIMES = 1_000
SYM = {:foo => "bar"}
STR = {"foo" => "bar"}
RBench.run(TIMES) do
column :sym
column :str
report "hash lookup" do
sym { SYM[:foo] }
str { STR["foo"] }
end
end