-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[stdlib] Collapse sequence and collection wrappers #20221
[stdlib] Collapse sequence and collection wrappers #20221
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
87197ab
to
8b5d6f9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8b5d6f9
to
0b260bf
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0b260bf
to
5b05c1c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5b05c1c
to
22ed8bc
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1fa0987
to
38a13c1
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
38a13c1
to
4cf80a4
Compare
@swift-ci please test |
Build failed |
Build failed |
4cf80a4
to
eac0e70
Compare
(test will fail but I want to track exactly where) |
@swift-ci please smoke test macOS platform |
f6545f7
to
e6a7598
Compare
@swift-ci please test |
Build failed |
7bfa7bf
to
712a6e7
Compare
@swift-ci please test |
Build failed |
Remove split customization point Eliminate SubSequence from Sequence protocol Collapse LazyCollection Collapse LazyMapCollection Eliminate _SequenceWrapper Collapse LazyFilterCollection Collapse LazyDrop/PrefixWhileCollection Fix tests, ABI stability update Collapse FlattenSequence
712a6e7
to
5858671
Compare
@swift-ci please benchmark |
@swift-ci please test |
Build comment file:Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
Performance: -Onone
Code size: -swiftlibs
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
rotated.reserveCapacity(ringBuffer.count) | ||
rotated += ringBuffer[i..<ringBuffer.endIndex] | ||
rotated += ringBuffer[0..<i] | ||
return rotated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this copying approach compare to in-place rotation?
ringBuffer[0..<i].reverse()
ringBuffer[i..<ringBuffer.endIndex].reverse()
ringBuffer[0..<ringBuffer.endIndex].reverse()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is there a potential perf. win in using ContiguousArray
s here (and in dropLast
) and then return Array(ringBuffer)
? I've noticed that's what map
and filter
implementations use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either are worth exploring to see – they're not important for the ABI though so we can look at trying them out after this change lands.
Builds on top of #20175 and collapses wrappers like
LazyMapSequence
andLazyMapCollection
into one now this is possible.