Project

General

Profile

Feature #10585 » 0003-benchmark-struct-name.patch

funny_falcon (Yura Sokolov), 12/10/2014 02:31 PM

View differences:

benchmark/bm_vm2_struct_big_href_hi.rb
s = Struct.new(*('a'..'z').map { |x| x.to_sym })
x = s.new
i = 0
while i<6_000_000 # benchmark loop 2
i += 1
x[:z]
end
benchmark/bm_vm2_struct_big_href_lo.rb
s = Struct.new(*('a'..'z').map { |x| x.to_sym })
x = s.new
i = 0
while i<6_000_000 # benchmark loop 2
i += 1
x[:k]
end
benchmark/bm_vm2_struct_big_hset.rb
s = Struct.new(*('a'..'z').map { |x| x.to_sym })
x = s.new
i = 0
while i<6_000_000 # benchmark loop 2
i += 1
x[:k] = i
end
benchmark/bm_vm2_struct_small_href.rb
s = Struct.new(:a, :b, :c)
x = s.new
i = 0
while i<6_000_000 # benchmark loop 2
i += 1
x[:a]
end
benchmark/bm_vm2_struct_small_hset.rb
s = Struct.new(:a, :b, :c)
x = s.new
i = 0
while i<6_000_000 # benchmark loop 2
i += 1
x[:a] = 1
end
(3-3/5)