Kaydet (Commit) cc15b42e authored tarafından Guido van Rossum's avatar Guido van Rossum

Change comment about MINSIZE -- 10 is optimal for Python.

üst 81a6fe9b
...@@ -630,9 +630,12 @@ insertionsort(array, size, compare) ...@@ -630,9 +630,12 @@ insertionsort(array, size, compare)
} }
/* MINSIZE is the smallest array we care to partition; smaller arrays /* MINSIZE is the smallest array we care to partition; smaller arrays
are sorted using a straight insertion sort (above). You may want are sorted using a straight insertion sort (above). It must be at
to play with this to tune it for your system. It must be at least least 2 for the quicksort implementation to work. Assuming that
2; more than 20 probably doesn't make sense. */ 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 #define MINSIZE 10
/* STACKSIZE is the size of our work stack. A rough estimate is that /* STACKSIZE is the size of our work stack. A rough estimate is that
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment