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