ruby-changes:44089
From: naruse <ko1@a...>
Date: Thu, 15 Sep 2016 01:01:12 +0900 (JST)
Subject: [ruby-changes:44089] naruse:r56161 (trunk): * benchmark/: add vnmakarov's benchmarks around hash
naruse 2016-09-15 01:00:55 +0900 (Thu, 15 Sep 2016) New Revision: 56161 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56161 Log: * benchmark/: add vnmakarov's benchmarks around hash [ruby-core:75265] Added files: trunk/benchmark/bm_bighash.rb trunk/benchmark/bm_hash_long.rb trunk/benchmark/bm_hash_small2.rb trunk/benchmark/bm_hash_small4.rb trunk/benchmark/bm_hash_small8.rb Modified files: trunk/ChangeLog Index: benchmark/bm_hash_small4.rb =================================================================== --- benchmark/bm_hash_small4.rb (revision 0) +++ benchmark/bm_hash_small4.rb (revision 56161) @@ -0,0 +1 @@ +1000000.times.map{|i| a={}; 4.times{|j| a[j]=j}; a} Index: benchmark/bm_hash_small2.rb =================================================================== --- benchmark/bm_hash_small2.rb (revision 0) +++ benchmark/bm_hash_small2.rb (revision 56161) @@ -0,0 +1 @@ +1000000.times.map{|i| a={}; 2.times{|j| a[j]=j}; a} Index: benchmark/bm_hash_small8.rb =================================================================== --- benchmark/bm_hash_small8.rb (revision 0) +++ benchmark/bm_hash_small8.rb (revision 56161) @@ -0,0 +1 @@ +1000000.times.map{|i| a={}; 8.times{|j| a[j]=j}; a} Index: benchmark/bm_hash_long.rb =================================================================== --- benchmark/bm_hash_long.rb (revision 0) +++ benchmark/bm_hash_long.rb (revision 56161) @@ -0,0 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_hash_long.rb#L1 +k1 = "Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong"; +k2 = "Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping"; +h = {k1 => 0, k2 => 0}; +3000000.times{|i| k = i % 2 ? k2 : k1; h [k] = h[k] + 1} Index: benchmark/bm_bighash.rb =================================================================== --- benchmark/bm_bighash.rb (revision 0) +++ benchmark/bm_bighash.rb (revision 56161) @@ -0,0 +1 @@ +h = {}; 5000000.times {|n| h[n] = n } Index: ChangeLog =================================================================== --- ChangeLog (revision 56160) +++ ChangeLog (revision 56161) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Sep 15 00:59:30 2016 NARUSE, Yui <naruse@r...> + + * benchmark/: add vnmakarov's benchmarks around hash [ruby-core:75265] + Wed Sep 14 07:02:31 2016 NARUSE, Yui <naruse@r...> * hash.c (each_pair_i_fast): use rb_yield_values2 to avoid var args. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/