1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/benchmark/array_min.yml
Kenta Murata b4e784434c
Optimize Array#min (#3324)
The benchmark result is below:

|                |compare-ruby|built-ruby|
|:---------------|-----------:|---------:|
|ary2.min        |     39.105M|   39.442M|
|                |           -|     1.01x|
|ary10.min       |     23.995M|   30.762M|
|                |           -|     1.28x|
|ary100.min      |      6.249M|   10.783M|
|                |           -|     1.73x|
|ary500.min      |      1.408M|    2.714M|
|                |           -|     1.93x|
|ary1000.min     |    828.397k|    1.465M|
|                |           -|     1.77x|
|ary2000.min     |    332.256k|  570.504k|
|                |           -|     1.72x|
|ary3000.min     |    338.079k|  573.868k|
|                |           -|     1.70x|
|ary5000.min     |    168.217k|  286.114k|
|                |           -|     1.70x|
|ary10000.min    |     85.512k|  143.551k|
|                |           -|     1.68x|
|ary20000.min    |     43.264k|   71.935k|
|                |           -|     1.66x|
|ary50000.min    |     17.317k|   29.107k|
|                |           -|     1.68x|
|ary100000.min   |      9.072k|   14.540k|
|                |           -|     1.60x|
|ary1000000.min  |     872.930|    1.436k|
|                |           -|     1.64x|

compare-ruby is 9f4b7fc82e.
2020-07-18 23:45:25 +09:00

31 lines
865 B
YAML

prelude: |
ary2 = 2.times.to_a.shuffle
ary10 = 10.times.to_a.shuffle
ary100 = 100.times.to_a.shuffle
ary500 = 500.times.to_a.shuffle
ary1000 = 1000.times.to_a.shuffle
ary2000 = 2500.times.to_a.shuffle
ary3000 = 2500.times.to_a.shuffle
ary5000 = 5000.times.to_a.shuffle
ary10000 = 10000.times.to_a.shuffle
ary20000 = 20000.times.to_a.shuffle
ary50000 = 50000.times.to_a.shuffle
ary100000 = 100000.times.to_a.shuffle
ary1000000 = 1000000.times.to_a.shuffle
benchmark:
ary2.min: ary2.min
ary10.min: ary10.min
ary100.min: ary100.min
ary500.min: ary500.min
ary1000.min: ary1000.min
ary2000.min: ary2000.min
ary3000.min: ary3000.min
ary5000.min: ary5000.min
ary10000.min: ary10000.min
ary20000.min: ary20000.min
ary50000.min: ary50000.min
ary100000.min: ary100000.min
ary1000000.min: ary1000000.min
loop_count: 10000