Closed vanvoorden closed 5 months ago
Here are benchmarks from running locally.
Note to self: letting Deque.SubSequence
be the default Slice<Deque>
means that it can't conform to Equatable
/Hashable
, and that is probably a defect in the Standard Library.
@swift-ci test
@lorentey Thanks for reviewing!
Background
https://github.com/apple/swift-collections/pull/335
Similar to what we added for
OrderedDictionary
, we can try and optimize ourDeque
equality checks for the case where twoDeque
instances point to the same identity.Unlike
OrderedDictionary
, ourDeque
is not implemented onContiguousArray
. We can try and mimic the approach fromContiguousArray
here inDeque
by checking against the identity of the underlyingManagedBufferPointer
instance.Changes
From:
To:
Test Plan
We leverage the existing
DequeTests
.Open Questions
Are there any additional edge-casey behaviors we should be testing for?
Checklist