]> granicus.if.org Git - python/commit
Gave this a facelift: "/" vs "//", whrandom vs random, etc. Boosted
authorTim Peters <tim.peters@gmail.com>
Thu, 18 Jul 2002 15:53:32 +0000 (15:53 +0000)
committerTim Peters <tim.peters@gmail.com>
Thu, 18 Jul 2002 15:53:32 +0000 (15:53 +0000)
commit8b6ec79b74284873696b24ab979fb1cb579b86f8
treec8754c65540f83d4ff624eed6a037d067382fddb
parent30d489651101ef9f34cad4124b404371a2eeef72
Gave this a facelift:  "/" vs "//", whrandom vs random, etc.  Boosted
the default range to end at 2**20 (machines are much faster now).
Fixed what was quite a arguably a bug, explaining an old mystery:  the
"!sort" case here contructs what *was* a quadratic-time disaster for
the old quicksort implementation.  But under the current samplesort, it
always ran much faster than *sort (the random case).  This never made
sense.  Turns out it was because !sort was sorting an integer array,
while all the other cases sort floats; and comparing ints goes much
quicker than comparing floats in Python.  After changing !sort to chew
on floats instead, it's now slower than the random sort case, which
makes more sense (but is just a few percent slower; samplesort is
massively less sensitive to "bad patterns" than quicksort).
Lib/test/sortperf.py