-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc++] "Bottom-up heapsort" improvement to sort_heap.
https://en.wikipedia.org/wiki/Heapsort#Bottom-up_heapsort In `pop_heap` specifically, the item we insert at the top and sift downward is guaranteed to be leaf-sized, so we expect it to go pretty far down. Sift it down as if it were INT_MIN, and then bubble it back up if needed. Also known as "heapsort with bounce." Numbers are here: https://godbolt.org/z/cvfnYW6fe Fixes #10008. Differential Revision: https://reviews.llvm.org/D118003
- Loading branch information
Arthur O'Dwyer
committed
Mar 8, 2022
1 parent
e3d3755
commit 79d08e3
Showing
4 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters