зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
2bbd6f18cd
Коммит
2abf156304
|
@ -1,3 +1,7 @@
|
|||
Thu Sep 15 00:59:30 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* benchmark/: add vnmakarov's benchmarks around hash [ruby-core:75265]
|
||||
|
||||
Wed Sep 14 07:02:31 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* hash.c (each_pair_i_fast): use rb_yield_values2 to avoid var args.
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
h = {}; 5000000.times {|n| h[n] = n }
|
|
@ -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}
|
|
@ -0,0 +1 @@
|
|||
1000000.times.map{|i| a={}; 2.times{|j| a[j]=j}; a}
|
|
@ -0,0 +1 @@
|
|||
1000000.times.map{|i| a={}; 4.times{|j| a[j]=j}; a}
|
|
@ -0,0 +1 @@
|
|||
1000000.times.map{|i| a={}; 8.times{|j| a[j]=j}; a}
|
Загрузка…
Ссылка в новой задаче