[Python-Dev] Sorting

M.-A. Lemburg mal@lemburg.com
Fri, 26 Jul 2002 09:35:07 +0200

Tim Peters wrote:
> One more bit of news:  cross-box performance of this stuff is baffling.
> Nobody else has tried timsort yet (unless someone who asked for the code
> tried an earlier version), but there are Many Mysteries just looking at the
> numbers for /sort under current CVS Python.  Recall that /sort is the case
> where the data is already sorted:  it does N-1 compares in one scan, and
> that's all.  For an array with 2**20 distinct floats that takes 0.35 seconds
> on my Win98SE 866MHz Pentium box, compiled w/ MSVC6.  On my Win2K 866MHz
> Pentium box, compiled w/ MSVC6, it takes 0.58(!) seconds, and indeed all the
> sort tests take incredibly much longer on the Win2K box.  On Fred's faster
> Pentium box (I forget exactly how fast, >900MHz and <1GHz), using gcc, the
> sort tests take a lot less time than on my Win2K box, but my Win98SE box is
> still faster.
> Another Mystery (still with the current samplesort):  on Win98SE, !sort is
> always a bit faster than *sort.  On Win2K and on Fred's box, it's always a
> bit slower.  I'm leaving that a mystery too.  I haven't tried timsort on
> another box yet, and given that my home machine may be supernaturally fast,
> I'm never going to <wink>.

I can give it a go on my AMD boxes if you send me the code.
They tend to show surprising results as you know :-)

Marc-Andre Lemburg
CEO eGenix.com Software GmbH
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/