]> granicus.if.org Git - python/commitdiff
Change comment about MINSIZE -- 10 is optimal for Python.
authorGuido van Rossum <guido@python.org>
Mon, 16 Dec 1996 03:32:39 +0000 (03:32 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 16 Dec 1996 03:32:39 +0000 (03:32 +0000)
Objects/listobject.c

index a985aa33ce4d56851bfcff60996b1bbaebe7dc7d..2fb67b9883299e3e850dca397ae96dbf5ae32aee 100644 (file)
@@ -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