diff options
author | Guido van Rossum <guido@python.org> | 1996-12-16 03:32:39 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-12-16 03:32:39 (GMT) |
commit | cc15b42e5919548e8d7008776f4c87f2267a00b3 (patch) | |
tree | 3a635a5a4d33379a5d9cb53ea5edf427059f52ff /Objects | |
parent | 81a6fe9b98e75aae585dcf3e7c50b99629accb7c (diff) | |
download | cpython-cc15b42e5919548e8d7008776f4c87f2267a00b3.zip cpython-cc15b42e5919548e8d7008776f4c87f2267a00b3.tar.gz cpython-cc15b42e5919548e8d7008776f4c87f2267a00b3.tar.bz2 |
Change comment about MINSIZE -- 10 is optimal for Python.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/listobject.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index a985aa3..2fb67b9 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -630,9 +630,12 @@ insertionsort(array, size, compare) } /* 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 |