Sorting according to a primary and secondary criterion

bearophile bearophileHUGS at lycos.com
Wed Jul 17 05:59:12 PDT 2013


Joseph Rushton Wakeling:

> Actually, I don't find it needs any more memory than regular 
> schwartzSort (which I was using anyway),

A and array of tuples should take more memory. Try with a much 
larger input array.


> but it does cost _speed_ -- quite a lot. :-(

Right, schwartzSort is quite slow:
http://d.puremagic.com/issues/show_bug.cgi?id=5077

But thankfully there are simple means to speed up schwartzSort... 
(like using alloca for small input arrays, improving its code, 
using minimallyInitializedArray, etc).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list