Actions
Bug #13340
closedImprove performance of Array#sort with float elements
Description
Array#sort with float elements will be over 2 times faster.
Before¶
user system total real
5.650000 0.020000 5.670000 ( 5.661151)
After¶
user system total real
2.410000 0.010000 2.420000 ( 2.427718)
Test code¶
require 'benchmark'
Benchmark.bmbm do |x|
ary = []
1000.times { |i| ary << Random.rand }
x.report do
10000.times do
ary.sort
end
end
end
Patch¶
The patch is in https://github.com/ruby/ruby/pull/1539
Actions
Like0
Like0Like0