Mercurial > cpython-lru_cache-weakref
diff Objects/listobject.c @ 4732:d367014200bb legacy-trunk
Change comment about MINSIZE -- 10 is optimal for Python.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 16 Dec 1996 03:32:39 +0000 |
| parents | c2b831f923c2 |
| children | b1fc4eb2ac5a |
line wrap: on
line diff
--- a/Objects/listobject.c Fri Dec 13 23:29:09 1996 +0000 +++ b/Objects/listobject.c Mon Dec 16 03:32:39 1996 +0000 @@ -630,9 +630,12 @@ } /* MINSIZE is the smallest array we care to partition; smaller arrays - are sorted using a straight insertion sort (above). You may want - to play with this to tune it for your system. It must be at least - 2; more than 20 probably doesn't make sense. */ + are sorted using a straight insertion sort (above). It must be at + least 2 for the quicksort implementation to work. Assuming that + comparisons are more expensive than everything else (and this is a + good assumption for Python), it should be 10, which is the cutoff + point: quicksort requires more comparisons than insertion sort for + smaller arrays. */ #define MINSIZE 10 /* STACKSIZE is the size of our work stack. A rough estimate is that
