Project

General

Profile

Feature #12142 » new-hash-table-benchmarks.patch

Missed new hash table benchmarks - vmakarov (Vladimir Makarov), 04/30/2016 02:28 PM

View differences:

benchmark/bm_bighash.rb
h = {}; 5000000.times {|n| h[n] = n }
benchmark/bm_hash_long.rb
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}
benchmark/bm_hash_small2.rb
1000000.times.map{|i| a={}; 2.times{|j| a[j]=j}; a}
benchmark/bm_hash_small4.rb
1000000.times.map{|i| a={}; 4.times{|j| a[j]=j}; a}
benchmark/bm_hash_small8.rb
1000000.times.map{|i| a={}; 8.times{|j| a[j]=j}; a}
(6-6/12)