diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-13 09:25:38 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-13 09:25:38 +0000 |
commit | cb8012f5c0a6bb8dd62e788c5484b92b3c7df978 (patch) | |
tree | 098346926986c3a5c4d298f6c0012e5246ceabb1 /benchmark | |
parent | 53430e355ad5e52504f9a9848447ffb926e4fb6c (diff) | |
download | ruby-cb8012f5c0a6bb8dd62e788c5484b92b3c7df978.tar.gz |
array.c: improve performance of Array#sort with block
* array.c (sort_1): improve performance of Array#sort with block
* benchmark/bm_array_sort_block.rb: added for Array#sort with block
[Bug #13344]
[ruby-dev:50027]
[Fix GH-1544]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/bm_array_sort_block.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/benchmark/bm_array_sort_block.rb b/benchmark/bm_array_sort_block.rb new file mode 100644 index 0000000000..3579786056 --- /dev/null +++ b/benchmark/bm_array_sort_block.rb @@ -0,0 +1,2 @@ +ary = Array.new(1000) { rand(1000) } +10000.times { ary.sort { |a, b| a <=> b } } |