-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Heap] Performance tweaks #78
Conversation
@swift-ci test |
I'd be interested to see the performance difference here. |
Removing I'd like to keep an eye on code size though -- always inlining large(ish) functions is generally a bad move. We'll see if followup work can make some of this work better. |
The thing I'm worried about is that the sequence-based initializer, insertions, removals are currently all emitted as large monolithic functions, with no code sharing between them. They aren't terribly large (e.g., the sequence initializer is 1200 bytes on x86_64), but they get duplicated with each specialization, and this can add up. If we can arrange things so that the bubbleUp/Down function calls remain intact without ruining performance, then that would calm my nerves a bit. :-) |
(The original link was pointing to course materials at a random university.)
This reverts commit 07ffd65.
`_Node` is a new struct that consists of a storage offset (the old index) along with its level in the tree. The level can be incrementally calculated, saving some time vs counting bits whenever it's needed.
Introduce `Heap._UnsafeHandle` (a thin wrapper around an unsafe buffer pointer) and rebase most heap algorithms on top of that instead of array operations. This simplifies things by reducing (hopefully) unnecessary index validation, resulting in some measurable performance improvements.
Not inlining such a large function speeds things up by leaving some headroom for the optimizer to make better inlining decisions elsewhere. (Force inlining this resulted in the compiler not inlining the closure passed to `_update` instead, which isn't a great tradeoff. To speed things up, mark `bubbleUp` with `@_effects(releasenone)`. This may be questionable (because it calls `Element.<`), but it results in better codegen, making `insert` match the performance of `std::priority_queue`.
@swift-ci test |
@swift-ci test |
This gets us to ~parity with |
Cc @AquaGeek Most of these are dirty tricks that reduce code readability (with the possible exception of The addition of the |
Looks like interesting progress - just one thought, wouldn’t it make sense to use e.g https://github.com/skarupke/heap as the reference for the heap performance rather than the std-prioq? (And compare the actual PriorityQueue with the std-prioq). |
Seems |
It would be interesting to see benchmarks against @skarupke's implementation! I'll see if I have time to run some experiments over the weekend. 🤔 We won't add those benchmarks to this repository though. Another interesting source of data structure implementations would be LLVM's ADT library. I don't think we need to add an extensive library of reference benchmarks though -- verifying against some plausible baseline is useful during the initial implementation effort, but afterwards I believe we should be primarily comparing potential changes against earlier versions of this package, not against other languages. |
One thing that we still need to address is that the code does not currently implement the optimization techniques that make https://github.com/skarupke/heap fast. We need to reorder comparisons in the grandchild min/max search, and use a more clever heapify loop. |
The results above were collected on a 5-years old MacBook Pro. M1 results below! The Versus baselines: |
Drive-by comment: Have you tried using a If you need it as an |
Oh yeah, that's a good suggestion; OrderedSet does the same. It shouldn't* have an effect on the current benchmarks, as * Although ContinuousArray sometimes misses some of the optimization love that Array gets, so it could be slower sometimes -- for instance, I forgot to apply swiftlang/swift#38867 to ContiguousArray just now. 🤦 |
This improves popMin/popMax (and the sequence initializer) by reviewing trickleDown and optimizing things: - Replace swapAt with a scheme where we keep a hold in the storage buffer - Slightly shorten min/max dependency chain in primary sink loop In exchange, we get even less readable code.
c4282ca improves popMin/popMax (and the sequence initializer) by reviewing trickleDown and optimizing things:
In exchange, we get even less readable code. M1 benchmarks: |
@swift-ci test |
This reintroduces retain/release operations for the empty array until swiftlang/swift#38898 lands. Mitigate the performance costs of this by refactoring code to reduce the size of the inlined bubbleUpMin/Max invocations.
ffce973
to
26d515b
Compare
OK, I'm happy with where we are now. I think Final measurements with a toolchain that includes swiftlang/swift#38867 & swiftlang/swift#38898: (taken on a Mac Pro this time) |
@swift-ci test |
This seems to have regressed the Windows build: https://dev.azure.com/compnerd/3133d6ab-80a8-4996-ac4f-03df25cd3224/_apis/build/builds/53542/logs/239 |
Update source list of priority queue implementation after apple#78
Update source list of priority queue implementation after #78
…v1.1.0 (#906) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [com_github_apple_swift_collections](https://github.com/apple/swift-collections) | http_archive | minor | `1.0.6` -> `1.1.0` | --- ### Release Notes <details> <summary>apple/swift-collections (com_github_apple_swift_collections)</summary> ### [`v1.1.0`](https://github.com/apple/swift-collections/releases/tag/1.1.0): Swift Collections 1.1.0 [Compare Source](https://github.com/apple/swift-collections/compare/1.0.6...1.1.0) This feature release adds a number of new data structure implementations, along with minor changes to existing constructs. ##### New Data Structures - `Heap` implements a min-max heap, backed by a native array. (Contributed by [@​AquaGeek](https://github.com/AquaGeek)) - `BitSet` and `BitArray` are two alternate representations of a bitmap type, backed by dynamically allocated storage. (Contributed by [@​MahanazAtiqullah](https://github.com/MahanazAtiqullah)) - `TreeSet` and `TreeDictionary` are hashed collections implementing Compressed Hash-Array Mapped Prefix Trees (CHAMP). They provide similar API as `Set`/`Dictionary` in the Standard Library, but as persistent data structures, supporting incremental mutations of shared instances and efficient structural diffing. (Contributed by [@​msteindorfer](https://github.com/msteindorfer)) ##### Other Changes - This version of the package can only be built using Swift 5.7 or later. - New methods: the `OrderedSet.isEqualSet` family of functions provide a way to test that two containers contain the same members, ignoring the order of elements. ([https://github.com/apple/swift-collections/issues/183](https://github.com/apple/swift-collections/issues/183), [https://github.com/apple/swift-collections/pull/234](https://github.com/apple/swift-collections/pull/234)) - New method: `OrderedSet.filter` implements a version of the standard filter operation that returns an `OrderedSet` instead of an `Array`. ([https://github.com/apple/swift-collections/pull/159](https://github.com/apple/swift-collections/pull/159)) - `debugDescription` implementations have been updated to follow Swift best practice. (These are called by container types like `Array` to print their elements, so they work best when they're succinct variants of `description` that are suitable for embedding in structured output: specifically, they must not produce unpaired delimiter characters (`[`/`]`, `(`/`)`, `{`/`}`, `<`/`>` etc), raw top level commas, semicolons, colons, unquoted strings etc. `debugDescription` should not needlessly print type names etc.) ##### New Contributors - [@​AquaGeek](https://github.com/AquaGeek) made their first contribution in [https://github.com/apple/swift-collections/pull/61](https://github.com/apple/swift-collections/pull/61) - [@​ejmarchant](https://github.com/ejmarchant) made their first contribution in [https://github.com/apple/swift-collections/pull/82](https://github.com/apple/swift-collections/pull/82) - [@​just-gull](https://github.com/just-gull) made their first contribution in [https://github.com/apple/swift-collections/pull/115](https://github.com/apple/swift-collections/pull/115) - [@​jPaolantonio](https://github.com/jPaolantonio) made their first contribution in [https://github.com/apple/swift-collections/pull/121](https://github.com/apple/swift-collections/pull/121) - [@​MahanazAtiqullah](https://github.com/MahanazAtiqullah) made their first contribution in [https://github.com/apple/swift-collections/pull/83](https://github.com/apple/swift-collections/pull/83) - [@​hectormatos2011](https://github.com/hectormatos2011) made their first contribution in [https://github.com/apple/swift-collections/pull/155](https://github.com/apple/swift-collections/pull/155) - [@​ktoso](https://github.com/ktoso) made their first contribution in [https://github.com/apple/swift-collections/pull/159](https://github.com/apple/swift-collections/pull/159) - [@​CTMacUser](https://github.com/CTMacUser) made their first contribution in [https://github.com/apple/swift-collections/pull/116](https://github.com/apple/swift-collections/pull/116) - [@​hassila](https://github.com/hassila) made their first contribution in [https://github.com/apple/swift-collections/pull/297](https://github.com/apple/swift-collections/pull/297) Many thanks to our contributors for their great work (and patience)! ##### List of Pull Requests **Full Changelog**: apple/swift-collections@1.0.6...1.1.0 - Add a min-max heap implementation that can be used to back a priority queue by [@​AquaGeek](https://github.com/AquaGeek) in [https://github.com/apple/swift-collections/pull/61](https://github.com/apple/swift-collections/pull/61) - \[benchmark] Review and extend Heap benchmarks by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/76](https://github.com/apple/swift-collections/pull/76) - Add reference benchmarks for bit vector implementations by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/79](https://github.com/apple/swift-collections/pull/79) - Fix Markdown link in README by [@​AquaGeek](https://github.com/AquaGeek) in [https://github.com/apple/swift-collections/pull/77](https://github.com/apple/swift-collections/pull/77) - Fix documentation for types conforming to ExpressibleByArrayLiteral o… by [@​ejmarchant](https://github.com/ejmarchant) in [https://github.com/apple/swift-collections/pull/82](https://github.com/apple/swift-collections/pull/82) - \[Heap] Performance tweaks by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/78](https://github.com/apple/swift-collections/pull/78) - Fix typos: missing subscript parameters by [@​ejmarchant](https://github.com/ejmarchant) in [https://github.com/apple/swift-collections/pull/81](https://github.com/apple/swift-collections/pull/81) - \[Heap] Update implementation details section in docs by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/84](https://github.com/apple/swift-collections/pull/84) - Update CMakeLists.txt by [@​compnerd](https://github.com/compnerd) in [https://github.com/apple/swift-collections/pull/85](https://github.com/apple/swift-collections/pull/85) - Stop depending on swift-collections-benchmark by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/86](https://github.com/apple/swift-collections/pull/86) - \[OrderedDictionary] modifyValue → updateValue by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/91](https://github.com/apple/swift-collections/pull/91) - Add Benchmarks package to workspace by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/93](https://github.com/apple/swift-collections/pull/93) - \[OrderedDictionary] Deprecate `subscript(offset:)` for now by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/92](https://github.com/apple/swift-collections/pull/92) - Documentation: Remove in-place mutation comments by [@​ejmarchant](https://github.com/ejmarchant) in [https://github.com/apple/swift-collections/pull/96](https://github.com/apple/swift-collections/pull/96) - \[main] Freeze some types for consistency with their inlinable initializers by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/98](https://github.com/apple/swift-collections/pull/98) - Follow stdlib's leading underscore rule by [@​ejmarchant](https://github.com/ejmarchant) in [https://github.com/apple/swift-collections/pull/95](https://github.com/apple/swift-collections/pull/95) - \[Heap] Disable heap tests in release builds by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/100](https://github.com/apple/swift-collections/pull/100) - \[NFC] Merge release/1.0 to main by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/105](https://github.com/apple/swift-collections/pull/105) - Merge `release/1.0` into `main` by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/108](https://github.com/apple/swift-collections/pull/108) - \[README] Note that `Heap` hasn't been tagged yet & list other enhancements in progress by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/109](https://github.com/apple/swift-collections/pull/109) - PriorityQueueModule: remove `import Foundation` by [@​compnerd](https://github.com/compnerd) in [https://github.com/apple/swift-collections/pull/118](https://github.com/apple/swift-collections/pull/118) - \[Heap] Remove Heap's `ascending` and `descending` views by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/119](https://github.com/apple/swift-collections/pull/119) - \[Heap] Enable heap tests in optimized builds ([#​101](https://github.com/apple/swift-collections/issues/101)) by [@​just-gull](https://github.com/just-gull) in [https://github.com/apple/swift-collections/pull/115](https://github.com/apple/swift-collections/pull/115) - Update CMakeLists.txt by [@​compnerd](https://github.com/compnerd) in [https://github.com/apple/swift-collections/pull/122](https://github.com/apple/swift-collections/pull/122) - Fix link to package internal documentation by [@​jPaolantonio](https://github.com/jPaolantonio) in [https://github.com/apple/swift-collections/pull/121](https://github.com/apple/swift-collections/pull/121) - Merge release/1.0 to main by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/130](https://github.com/apple/swift-collections/pull/130) - BitArray and BitSet data structures by [@​MahanazAtiqullah](https://github.com/MahanazAtiqullah) in [https://github.com/apple/swift-collections/pull/83](https://github.com/apple/swift-collections/pull/83) - Sorted collections by [@​vihanb](https://github.com/vihanb) in [https://github.com/apple/swift-collections/pull/65](https://github.com/apple/swift-collections/pull/65) - Merge `release/1.0` to `main` by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/141](https://github.com/apple/swift-collections/pull/141) - Remove Swift PM Artifacts to avoid Generated Schemes in Xcode by [@​hectormatos2011](https://github.com/hectormatos2011) in [https://github.com/apple/swift-collections/pull/155](https://github.com/apple/swift-collections/pull/155) - Reinstate custom schemes under Utils/swift-collections.xcworkspace by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/156](https://github.com/apple/swift-collections/pull/156) - \+OrderedSet add filter [#​158](https://github.com/apple/swift-collections/issues/158) by [@​ktoso](https://github.com/ktoso) in [https://github.com/apple/swift-collections/pull/159](https://github.com/apple/swift-collections/pull/159) - \[Xcode] Update schemes & file template by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/161](https://github.com/apple/swift-collections/pull/161) - \[OrderedCollection] Use standard temp allocation facility, if available by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/160](https://github.com/apple/swift-collections/pull/160) - \[OrderedSet] Work around weird name lookup issue in compiler by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/162](https://github.com/apple/swift-collections/pull/162) - \=OrderedSet.filter Attempt to optimize filter impl by [@​ktoso](https://github.com/ktoso) in [https://github.com/apple/swift-collections/pull/163](https://github.com/apple/swift-collections/pull/163) - Force-inline \_modify accessors to work around a performance issue by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/165](https://github.com/apple/swift-collections/pull/165) - Merge release/1.0 branch to main by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/172](https://github.com/apple/swift-collections/pull/172) - Incubate persistent data structures by [@​msteindorfer](https://github.com/msteindorfer) in [https://github.com/apple/swift-collections/pull/31](https://github.com/apple/swift-collections/pull/31) - Persistent collections updates by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/174](https://github.com/apple/swift-collections/pull/174) - Persistent collections updates by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/175](https://github.com/apple/swift-collections/pull/175) - Persistent collections updates (part 3) by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/176](https://github.com/apple/swift-collections/pull/176) - Persistent collections updates (part 4) by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/177](https://github.com/apple/swift-collections/pull/177) - \[OrderedDictionary] Tiny documentation fix by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/178](https://github.com/apple/swift-collections/pull/178) - Persistent collections updates (part 5) by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/179](https://github.com/apple/swift-collections/pull/179) - Integrate PriorityQueueModule, BitCollections, PersistentCollections, SortedCollections into release/1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/181](https://github.com/apple/swift-collections/pull/181) - Persistent collections updates (part 6) by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/180](https://github.com/apple/swift-collections/pull/180) - Persistent collections updates (part 7) by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/182](https://github.com/apple/swift-collections/pull/182) - \[BitSet] Fix decoding format on 32 bit architectures by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/185](https://github.com/apple/swift-collections/pull/185) - Persistent collections updates (part 8) by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/184](https://github.com/apple/swift-collections/pull/184) - Persistent collections updates (part 9) by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/188](https://github.com/apple/swift-collections/pull/188) - Add Sendable conformances to all public types by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/191](https://github.com/apple/swift-collections/pull/191) - \[test] Check baseline API expectations for set-like types by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/192](https://github.com/apple/swift-collections/pull/192) - Fleshing out `PersistentSet` by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/193](https://github.com/apple/swift-collections/pull/193) - Rename `PriorityQueueModule` to `HeapModule` by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/194](https://github.com/apple/swift-collections/pull/194) - \[BitSet] Fix invariant violation in member subscript by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/195](https://github.com/apple/swift-collections/pull/195) - \[1.1.0] Bump minimum required Swift toolchain to 5.5 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/196](https://github.com/apple/swift-collections/pull/196) - Restore support for building with Swift 5.5 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/198](https://github.com/apple/swift-collections/pull/198) - Merge release/1.0 to release/1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/199](https://github.com/apple/swift-collections/pull/199) - Update CMake configuration in preparation for 1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/200](https://github.com/apple/swift-collections/pull/200) - Update CMakeLists.txt by [@​compnerd](https://github.com/compnerd) in [https://github.com/apple/swift-collections/pull/202](https://github.com/apple/swift-collections/pull/202) - \[1.1]\[SortedCollections] Remove for now by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/205](https://github.com/apple/swift-collections/pull/205) - \[Heap] Change value of minimum or maximum element by [@​CTMacUser](https://github.com/CTMacUser) in [https://github.com/apple/swift-collections/pull/116](https://github.com/apple/swift-collections/pull/116) - \[Heap] Prerelease preparations by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/210](https://github.com/apple/swift-collections/pull/210) - Update README files by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/212](https://github.com/apple/swift-collections/pull/212) - \[manifest] Exclude CMakeLists.txt; remove unnecessary path settings; reindent file by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/213](https://github.com/apple/swift-collections/pull/213) - Review and finalize (?) set relation predicates for 1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/216](https://github.com/apple/swift-collections/pull/216) - Merge.1.0→1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/217](https://github.com/apple/swift-collections/pull/217) - Update CMake configuration by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/218](https://github.com/apple/swift-collections/pull/218) - Cherry pick changes from main to release/1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/219](https://github.com/apple/swift-collections/pull/219) - Fix unusual build problems by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/221](https://github.com/apple/swift-collections/pull/221) - Review & update descriptions throughout the package by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/222](https://github.com/apple/swift-collections/pull/222) - Review and finalize (?) binary set operations for 1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/223](https://github.com/apple/swift-collections/pull/223) - \[Xcode] Disable implicit dependencies by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/227](https://github.com/apple/swift-collections/pull/227) - \[OrderedSet] Improve sequence-taking initializer by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/226](https://github.com/apple/swift-collections/pull/226) - \[OrderedSet, BitSet] Fix custom mirror display style by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/225](https://github.com/apple/swift-collections/pull/225) - Finalize persistent collections API by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/224](https://github.com/apple/swift-collections/pull/224) - Start working on DocC support by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/228](https://github.com/apple/swift-collections/pull/228) - Update CMake build configuration by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/230](https://github.com/apple/swift-collections/pull/230) - \[PersistentSet] Iterator.next(): Make inlinable by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/233](https://github.com/apple/swift-collections/pull/233) - \[SetAlgebra types] isEqual(to:) → isEqualSet(to:) by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/234](https://github.com/apple/swift-collections/pull/234) - \[PersistentCollections] Doc & benchmark updates in preparation of API review by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/235](https://github.com/apple/swift-collections/pull/235) - Apply changes from in-progress review thread by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/237](https://github.com/apple/swift-collections/pull/237) - \[ShareableHashedCollections] API Review: add missing `mutating` keywords by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/238](https://github.com/apple/swift-collections/pull/238) - \[Benchmarks] Split default huge library up into individual files, one per type by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/240](https://github.com/apple/swift-collections/pull/240) - \[ShareableHashedCollections] Add missing import by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/243](https://github.com/apple/swift-collections/pull/243) - Unify unsafe bit set implementations by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/244](https://github.com/apple/swift-collections/pull/244) - Fix warnings in development versions of Swift by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/245](https://github.com/apple/swift-collections/pull/245) - \[HashTreeCollections] Change prefix `Shareable` to `Tree` by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/242](https://github.com/apple/swift-collections/pull/242) - \[TreeDictionary] Fix in-place merge operation to properly update the count by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/247](https://github.com/apple/swift-collections/pull/247) - \[cmake] Update CMake configuration by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/249](https://github.com/apple/swift-collections/pull/249) - Add not so experimental rope implementation by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/264](https://github.com/apple/swift-collections/pull/264) - Fix off by one error in BitSet by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/267](https://github.com/apple/swift-collections/pull/267) - Monomodule support by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/266](https://github.com/apple/swift-collections/pull/266) - Expose a handful of BigString.Index methods by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/269](https://github.com/apple/swift-collections/pull/269) - BitArray API refinements & additions by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/263](https://github.com/apple/swift-collections/pull/263) - Make most of Rope inlinable by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/270](https://github.com/apple/swift-collections/pull/270) - BigString: Fix String.Index.\_knownScalarAligned by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/272](https://github.com/apple/swift-collections/pull/272) - Rope: Fix `Sendable` conformance by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/271](https://github.com/apple/swift-collections/pull/271) - Require Swift 5.6 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/273](https://github.com/apple/swift-collections/pull/273) - \[OrderedDictionary] Explicitly mention in documentation that keys/values are ordered by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/275](https://github.com/apple/swift-collections/pull/275) - \[HashCollections] Ensure `self` doesn’t get destroyed before we’re done working with it by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/276](https://github.com/apple/swift-collections/pull/276) - Remove obsolete swift(>=5.5)/swift(>=5.6) checks by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/277](https://github.com/apple/swift-collections/pull/277) - \[Xcode] Update Xcode project by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/278](https://github.com/apple/swift-collections/pull/278) - Minor rope updates by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/279](https://github.com/apple/swift-collections/pull/279) - \[Rope] remove(at:): Fix assertion when removing the last item creates a deficiency by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/280](https://github.com/apple/swift-collections/pull/280) - Merge changes from release 1.0 to release 1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/283](https://github.com/apple/swift-collections/pull/283) - \[CollectionUtilities] Silence a warning on 32 bit platforms by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/286](https://github.com/apple/swift-collections/pull/286) - \[BitSet] Fix a thinko in BitSet.isEqualSet by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/287](https://github.com/apple/swift-collections/pull/287) - Grab bag of fixes for small test issues by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/288](https://github.com/apple/swift-collections/pull/288) - \[Xcode] Set a code sign identity in the Xcode project by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/285](https://github.com/apple/swift-collections/pull/285) - Rope: Fix trap when replaceSubrange is called on an empty rope by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/290](https://github.com/apple/swift-collections/pull/290) - `Rope.find` returns a bogus remainder for the end position by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/291](https://github.com/apple/swift-collections/pull/291) - Update TreeSet.md by [@​hassila](https://github.com/hassila) in [https://github.com/apple/swift-collections/pull/297](https://github.com/apple/swift-collections/pull/297) - Fix CustomStringConvertible/CustomDebugStringConvertible conformances by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/302](https://github.com/apple/swift-collections/pull/302) - \[RopeModule] Fix issues in Swift's ABI stable dialect by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/318](https://github.com/apple/swift-collections/pull/318) - \[CMake, Xcode] Update configurations for alternate build systems by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/319](https://github.com/apple/swift-collections/pull/319) - \[RopeModule] Remove unnecessary typealiases by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/320](https://github.com/apple/swift-collections/pull/320) - \[Heap] Improve type-level doc comment by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/326](https://github.com/apple/swift-collections/pull/326) - \[Heap] insert(contentsOf:) Switch to Floyd’s if we’re inserting too many items by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/327](https://github.com/apple/swift-collections/pull/327) - \[1.1] build: support building in Debug mode on Windows by [@​compnerd](https://github.com/compnerd) in [https://github.com/apple/swift-collections/pull/336](https://github.com/apple/swift-collections/pull/336) - Merge release/1.0 to release/1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/348](https://github.com/apple/swift-collections/pull/348) - \[Heap] Convert min() and max() to properties by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/328](https://github.com/apple/swift-collections/pull/328) - \[BitArray] Disable bitwise operators for now by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/353](https://github.com/apple/swift-collections/pull/353) - \[Heap] Final(?) Heap API adjustments for 1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/354](https://github.com/apple/swift-collections/pull/354) - \[Benchmarks] Add Collection Equality Benchmarks by [@​vanvoorden](https://github.com/vanvoorden) in [https://github.com/apple/swift-collections/pull/351](https://github.com/apple/swift-collections/pull/351) - Release preparations for 1.1 by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/355](https://github.com/apple/swift-collections/pull/355) - \[1.1] Fix typos by [@​lorentey](https://github.com/lorentey) in [https://github.com/apple/swift-collections/pull/357](https://github.com/apple/swift-collections/pull/357) - \[TreeDictionary]\[Keys] Add Equatable and Hashable Conformance to TreeDictionary.Keys by [@​vanvoorden](https://github.com/vanvoorden) in [https://github.com/apple/swift-collections/pull/352](https://github.com/apple/swift-collections/pull/352) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDAuMCIsInVwZGF0ZWRJblZlciI6IjM2LjEwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
@inline(__always)
has a detrimental effect when used on large functions. Let's not do that._Node
, precalculating levels for each offset (resolves [Heap] Switch to a custom _Index type that incrementally tracks depth #71)Add some (slightly questionable) effects attributes to heap internals.Checklist