1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool/hashbench2.rb
ko1 57bb153456 * common.mk: add new rules gcbench-rdoc', gcbench-hash'.
* tool/gcbench.rb: separate GC bench framework and process.
* tool/hashbench1.rb, tool/hashbench2.rb: add two types GC bench.
  hashbench1: many temporal objects (GC by newobj)
  hashbench2: hash size becomes bigger and bigger (GC by malloc)
  Two benchs are executed by `gcbench-hash' rule.
* tool/rdocbench.rb: separated.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19 22:33:02 +00:00

7 lines
80 B
Ruby

value = 0.01
h = {}
n = 4*(10**6)
1.upto(n){|i|
h["%020d" % i] = value * i
}