From: Matthew Kerwin Date: 2013-06-14T07:45:21+09:00 Subject: Re: Timsort in Ruby Alphonse 23 wrote in post #1112359: > So that's Ruby's sorting function... It doesn't even look like it's > checking the size of the array before sorting. Does this mean, quicksort > is used no matter what the size of the array. So even when I'm sorting > 10 elements, it's using quicksort? > > Ruby's quicksort function is 207 lines. Timsort is 1301 lines of C. > http://code.google.com/p/timsort/source/browse/trunk/timsort.c > > Shouldn't the Ruby community feel ashamed that Python has a more > optimized sorting function? So you're saying More SLOC = More Optimised? That's quite an arbitrary benchmark. If the performance of Ruby core's sorting is shameful to you, write a gem. And I really do mean that, the option is available, and it's a good way to eventually promote functionality into core. I'd be interested myself, if timsort didn't apparently require me to write and maintain 1300 lines of code. -- Posted via http://www.ruby-forum.com/.