-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Refactor Range Overlaps for Performance #23293
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] Refactor Range Overlaps for Performance #23293
Conversation
@swift-ci Please test |
Build failed |
@swift-ci Please test OS X platform |
25f469e
to
3fa7e82
Compare
@swift-ci please benchmark |
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 Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
@swift-ci Please benchmark |
3fa7e82
to
1ce3792
Compare
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 Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Just checked these out, didn't have time to investigate before. I think these regression must be noise, even though they are consistent – they don't use The benchmarks that actually use overlaps are consistently better. @airspeedswift Thoughts? |
@swift-ci Please benchmark |
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 Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
@swift-ci Please smoke test |
1ce3792
to
4e1afce
Compare
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
4e1afce
to
87f02b1
Compare
@swift-ci Please smoke test |
@airspeedswift Should be good to merge! |
Refactors the
overlaps(_:)
method forRange
&ClosedRange
to use fewer comparisons, and adds a benchmark.Speed-ups for
Int
ranges based on local running of the benchmark:Range
xRange
: 22%Range
xClosedRange
: 14%ClosedRange
xClosedRange
: 10%Speed-ups for
String
ranges based on a different local test:Range
xRange
: 22%Range
xClosedRange
: 48%ClosedRange
xClosedRange
: 44%Benchmark available separately in #23294.