mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-135551: Change how sorting picks minimum run length (#135553)
New scheme from Stefan Pochmann for picking minimum run lengths. By allowing them to change a little from one run to the next, it's possible to arrange for that all merges, at all levels, strongly tend to be as evenly balanced as possible, for randomly ordered data. Meaning the number of initial runs is a power of 2, and all merges involve runs whose lengths differ by no more than 1.
This commit is contained in:
parent
b38810bab7
commit
2fc68e180f
4 changed files with 184 additions and 41 deletions
|
@ -1481,6 +1481,7 @@ Jean-François Piéronne
|
|||
Oleg Plakhotnyuk
|
||||
Anatoliy Platonov
|
||||
Marcel Plch
|
||||
Stefan Pochmann
|
||||
Kirill Podoprigora
|
||||
Remi Pointel
|
||||
Jon Poler
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Sorting randomly ordered lists will often run a bit faster, thanks to a new scheme for picking minimum run lengths from Stefan Pochmann, which arranges for the merge tree to be as evenly balanced as is possible.
|
Loading…
Add table
Add a link
Reference in a new issue