ruby-changes:38915
From: normal <ko1@a...>
Date: Tue, 23 Jun 2015 05:10:23 +0900 (JST)
Subject: [ruby-changes:38915] normal:r50996 (trunk): add benchmarks for struct[:name]
normal 2015-06-23 05:10:07 +0900 (Tue, 23 Jun 2015) New Revision: 50996 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50996 Log: add benchmarks for struct[:name] * benchmark/bm_vm2_struct_big_href_hi.rb: new benchmark * benchmark/bm_vm2_struct_big_href_lo.rb: ditto * benchmark/bm_vm2_struct_big_hset.rb: ditto * benchmark/bm_vm2_struct_small_href.rb: ditto * benchmark/bm_vm2_struct_small_hset.rb: ditto Thanks to Sokolov Yura aka funny_falcon <funny.falcon@g...> in https://bugs.ruby-lang.org/issues/10585 Added files: trunk/benchmark/bm_vm2_struct_big_href_hi.rb trunk/benchmark/bm_vm2_struct_big_href_lo.rb trunk/benchmark/bm_vm2_struct_big_hset.rb trunk/benchmark/bm_vm2_struct_small_href.rb trunk/benchmark/bm_vm2_struct_small_hset.rb Modified files: trunk/ChangeLog Index: ChangeLog =================================================================== --- ChangeLog (revision 50995) +++ ChangeLog (revision 50996) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Jun 23 04:58:06 2015 Eric Wong <e@8...> + + * benchmark/bm_vm2_struct_big_href_hi.rb: new benchmark + * benchmark/bm_vm2_struct_big_href_lo.rb: ditto + * benchmark/bm_vm2_struct_big_hset.rb: ditto + * benchmark/bm_vm2_struct_small_href.rb: ditto + * benchmark/bm_vm2_struct_small_hset.rb: ditto + Thanks to Sokolov Yura aka funny_falcon <funny.falcon@g...> + in https://bugs.ruby-lang.org/issues/10585 + Mon Jun 22 18:08:48 2015 Naohisa Goto <ngotogenome@g...> * test/lib/test/unit.rb (Test::Unit::Parallel#start_watchdog): removed Index: benchmark/bm_vm2_struct_small_href.rb =================================================================== --- benchmark/bm_vm2_struct_small_href.rb (revision 0) +++ benchmark/bm_vm2_struct_small_href.rb (revision 50996) @@ -0,0 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm2_struct_small_href.rb#L1 +s = Struct.new(:a, :b, :c) +x = s.new +i = 0 +while i<6_000_000 # benchmark loop 2 + i += 1 + x[:a] +end Index: benchmark/bm_vm2_struct_big_hset.rb =================================================================== --- benchmark/bm_vm2_struct_big_hset.rb (revision 0) +++ benchmark/bm_vm2_struct_big_hset.rb (revision 50996) @@ -0,0 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm2_struct_big_hset.rb#L1 +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 Index: benchmark/bm_vm2_struct_big_href_hi.rb =================================================================== --- benchmark/bm_vm2_struct_big_href_hi.rb (revision 0) +++ benchmark/bm_vm2_struct_big_href_hi.rb (revision 50996) @@ -0,0 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm2_struct_big_href_hi.rb#L1 +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 Index: benchmark/bm_vm2_struct_big_href_lo.rb =================================================================== --- benchmark/bm_vm2_struct_big_href_lo.rb (revision 0) +++ benchmark/bm_vm2_struct_big_href_lo.rb (revision 50996) @@ -0,0 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm2_struct_big_href_lo.rb#L1 +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 Index: benchmark/bm_vm2_struct_small_hset.rb =================================================================== --- benchmark/bm_vm2_struct_small_hset.rb (revision 0) +++ benchmark/bm_vm2_struct_small_hset.rb (revision 50996) @@ -0,0 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_vm2_struct_small_hset.rb#L1 +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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/