-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Integer protocols] Make BinaryInteger.Words conform to RandomAccessCollection #19016
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
Conversation
@swift-ci please test compiler performance |
@swift-ci please test source compatibility |
@swift-ci please smoke test |
Resurrecting #12902 to see where we are now w.r.t. compiler performance. |
!!! Couldn't read commit file !!! |
@swift-ci please test source compatibility |
@swift-ci please test compiler performance |
Build comment file:Compilation-performance test failed |
@swift-ci please smoke test compiler performance |
!!! Couldn't read commit file !!! |
@airspeedswift I went for the full fledged |
Sounds right to me, unless @stephentyrone can think of a counter-example. |
@DougGregor @airspeedswift Right, with the note that if someone wraps an existing bignum library that uses sign-magnitude fixed-width integers under the covers, then accessing may be O(n), but they should be able to amortize it for sequential access, and that's only a performance note. I.e. it should always be possible to conform semantically. |
@swift-ci please smoke test Linux |
@swift-ci please test compiler performance |
!!! Couldn't read commit file !!! |
/// A type that represents the words of a binary integer. | ||
/// | ||
/// The `Words` type must conform to the `Collection` protocol with an | ||
/// `Element` type of `UInt`. | ||
associatedtype Words : Sequence where Words.Element == UInt | ||
associatedtype Words : RandomAccessCollection |
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.
🎉
@swift-ci please test compiler performance |
Build comment file:Compilation-performance test failed |
Release builds are busted so compiler performance is failing. |
@swift-ci please test compiler performance |
@swift-ci please test linux platform |
Build failed |
31337f7
to
2aaf379
Compare
@swift-ci please smoke test |
@swift-ci please test source compatibility |
Overall that's a 9% compile-time regression for debug builds and 4% compile-time regression for release builds. |
@swift-ci please benchmark |
1 similar comment
@swift-ci please benchmark |
@swift-ci please smoke test macOS |
Rebased, testing again, and running the benchmarks. It is possible-but-unlikely that adding constraints to |
Build comment file:Performance: -O
Performance: -Osize
Performance: -Onone
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 regressions before you merge the PR. Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein). Hardware Overview
|
@swift-ci please smoke test Linux |
@airspeedswift those benchmark regressions surprise me. Do they surprise you as well, or do these tend to be unstable benchmarks? |
Even if those regressions aren't noise, given that they're isolated I think that they're acceptable for this change. If they're real, we can fix them. |
@swift-ci please smoke test Linux |
I don't think they're all noise – the new benchmarks have proven to be really pretty stable. Certainly the repeated appearance of |
@swift-ci please test compiler performance |
@swift-ci please test |
Build failed |
That requirement that all conformances are string convertible seems bogus. Trying this again without it, you never know, might save a teeny bit of compilation performance... |
Build failed |
@swift-ci please smoke test macOS |
Build comment file:Summary for master fullUnexpected test results, excluded stats for RxSwift, ProcedureKit, ChattoAdditions, Wordy, ReactiveSwift Regressions found (see below) Debug-batchdebug-batch briefRegressed (2)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (1)
debug-batch detailedRegressed (8)
Improved (2)
Unchanged (delta < 1.0% or delta < 100.0ms) (81)
Releaserelease briefRegressed (1)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
release detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
|
Seems like that helped release but not debug ¯_(ツ)_/¯ |
@airspeedswift looks like there is more |
…ollection. Require that BinaryInteger.Words conform to RandomAccessCollection with an Index type of Int, simplifying clients. Fixes rdar://problem/36410936.
93d11ea
to
0a8058c
Compare
@swift-ci please smoke test |
Back to a clean, rebased PR |
@swift-ci please smoke test Linux |
Merging. Then.... try to recover the compile-time regression. |
Require that BinaryInteger.Words conform to RandomAccessCollection with
an Index type of Int, simplifying clients.
Fixes rdar://problem/36410936.