-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Deprecate MutableCollection._withUnsafeMutableBufferPointerIfSupported #36003
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] Deprecate MutableCollection._withUnsafeMutableBufferPointerIfSupported #36003
Conversation
…fSupported In Swift 5.0, [SE-0237] introduced the public `MutableCollection.withContiguousMutableStorageIfAvailable` method. It’s time we migrated off the old, underscored variant and deprecated it. The default `MutableCollection.sort` and `.partition(by:)` implementations are currently calling this hidden method rather than the documented interface, preventing custom Collection implementations from achieving good performance, even if they have contiguous storage. [SE-0237]: https://github.com/apple/swift-evolution/blob/master/proposals/0237-contiguous-collection.md
@swift-ci test |
@swift-ci benchmark |
Build failed |
Oh, nice, we have test coverage! ❤️
|
@swift-ci test |
@swift-ci benchmark |
Build failed |
Build failed |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow 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
|
<shameful facepalm> |
1ebbfab
to
b50db27
Compare
@swift-ci test |
Build failed |
Build failed |
stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift
Outdated
Show resolved
Hide resolved
stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift
Outdated
Show resolved
Hide resolved
stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift
Outdated
Show resolved
Hide resolved
stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift
Outdated
Show resolved
Hide resolved
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.
This is great! 👏
…Type.swift Co-authored-by: Nate Cook <[email protected]>
…Type.swift Co-authored-by: Nate Cook <[email protected]>
Co-authored-by: Nate Cook <[email protected]>
@swift-ci test |
Build failed |
Build failed |
@swift-ci test |
Build failed |
Hm. |
@swift-ci test linux platform |
@swift-ci test |
In Swift 5.0, SE-0237 introduced the public
MutableCollection.withContiguousMutableStorageIfAvailable
method. It’s time we migrated off the old, underscored variant and deprecated it.The default
MutableCollection.sort
and.partition(by:)
implementations are currently calling this hidden method rather than the documented interface, preventing custom Collection implementations from achieving good performance, even if they have contiguous storage.