Sorting algorithms benchmark

Deewiant deewiant.doesnotlike.spam at gmail.com
Wed Mar 7 10:59:53 PST 2007


Stewart Gordon wrote:
> Deewiant Wrote:
>> I added my comb sort 11 implementation to your benchmark, and 
>> it's noticeably faster for random data than your comb sort, at 
>> least on my machine.  So something's different, to be sure.  
>> Even without the optimization related to gap size 11, mine is 
>> faster.
> <snip>
> 
> That appears to be because you've implemented the optimum shrink factor.  If I change my implementation to use it as well, it runs at about the same speed as yours.
> 

Ah, of course. That clears it up.

I ran the whole benchmark: for these cases, merge sort and comb sort 11 are the
only two to beat the built-in sort (taking the average of the results of all 9
runs). Interesting.

-- 
Remove ".doesnotlike.spam" from the mail address.



More information about the Digitalmars-d-announce mailing list