diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-14 16:00:55 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-14 16:00:55 +0000 |
commit | 2abf156304a992689807d6d47102307447ce5e93 (patch) | |
tree | 042a94de8e7d6b872e754fb0299345c0e02b7f8c /benchmark/bm_hash_long.rb | |
parent | 2bbd6f18cd54040c7d1bd03ed8193b46104a1abb (diff) |
* benchmark/: add vnmakarov's benchmarks around hash [ruby-core:75265]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark/bm_hash_long.rb')
-rw-r--r-- | benchmark/bm_hash_long.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/benchmark/bm_hash_long.rb b/benchmark/bm_hash_long.rb new file mode 100644 index 0000000000..03d9109602 --- /dev/null +++ b/benchmark/bm_hash_long.rb @@ -0,0 +1,4 @@ +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} |