Repository navigation
Extract BinaryHeap from DataStructures.jl v1.0.0 - #1
Merged
ChrisRackauckas merged 1 commit intoApr 12, 2026
Merged
Conversation
Provides BinaryHeap, BinaryMinHeap, BinaryMaxHeap, and FasterForward/ FasterReverse orderings extracted from DataStructures.jl to eliminate method invalidations caused by loading the full DataStructures package. DataStructures.jl causes 6 invalidation trees (from OrderedCollections, Accumulators, SortedContainers) that are completely unrelated to heap functionality. BinaryHeaps.jl causes zero invalidations. Tests are extracted from DataStructures.jl test suite (493 tests pass). Original code Copyright (c) 2013 Dahua Lin, MIT License. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Merged
3 of 4 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BinaryHeap,BinaryMinHeap,BinaryMaxHeap, andFasterForward/FasterReverseorderings from DataStructures.jl into a standalone, lightweight packageheapify!,heappush!,heappop!,isheap) and utility functions (nlargest,nsmallest,extract_all!)Motivation
Loading
DataStructures.jlcauses 6 method invalidation trees from components completely unrelated to heap functionality (OrderedCollectionssort!/get!/getkey, Accumulatorsmerge!, SortedContainersIteratorSize/merge).BinaryHeaps.jlcauses zero invalidations.This is a drop-in replacement for
DataStructures.BinaryHeapusage in packages like OrdinaryDiffEq.jl, which only usesBinaryHeap{T}(FasterForward()),BinaryMinHeap,push!,pop!,first,isempty,empty!, andsizehint!.Attribution
Original code Copyright (c) 2013 Dahua Lin, MIT License.
Test plan
🤖 Generated with Claude Code