[Python-Dev] decorate-sort-undecorate

Tim Peters tim.one at comcast.net
Wed Oct 15 20:59:00 EDT 2003


[Guido]
> ...
> Given that the Jython folks had Tim's sort algorithm translated into
> Java in half a day, I don't see why we can't require all
> implementations to have a stable sort.  It's not like you can gain
> significant speed over Timsort.

I object to any sort that claims to be more stable than its author.
Speaking of which, by giving up the so-called stability of 2.3's
list.sort(), I can speed sorting of exponentially distributed random floats
by nearly 0.017%!  That's almost a fiftieth of a percent.  Some of the
floats in the result are smaller than their left neighbor, but that's only
because I had to mutate some of the values, and they're not a lot smaller
anyway.

adopting-the-consensus-view-of-floating-point-will-deliver-
    many-such-benefits-ly y'rs  - tim




More information about the Python-Dev mailing list