-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix bounds check in bridged ASCII String comparison #24457
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
Fix bounds check in bridged ASCII String comparison #24457
Conversation
@swift-ci please test |
Build failed |
Build failed |
@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
|
Test failures are due to forcing ASAN on for this test. Asking some folks what to do about that |
Do you think those performance regressions are real? I wonder why this change would hurt performance; aren't we passing a smaller byte count to |
de23660
to
e672675
Compare
The perf regressions aren't real, none of those tests use the code in question |
@swift-ci please test |
Build failed |
Yikes, they are very large-looking unreal regressions. |
Build failed |
e672675
to
7787385
Compare
7787385
to
008699e
Compare
@milseman pointed out an improved approach that makes this clearer and is likely a perf win at the same time :) |
@swift-ci please benchmark |
@swift-ci please test |
Build failed |
@swift-ci please benchmark |
Build failed |
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
|
That's very suspicious. The case that should have improved is maybe not covered by the benchmarks, and the case that claims to have maybe regressed is a) a very very low workload test, and b) takes a branch just before all the changed code. I'm still voting no actual change there. |
(the thing that will improve is when the Swift string is non-ascii and the NSString is ascii, we won't do all the work to build breadcrumbs) |
@Catfish-Man did this get cherry-picked to 5.1? |
Fixes rdar://problem/50407214
'count' is the UTF8 count of self, and the only String that we've proven is ASCII at this point is 'other', so 'count' can be greater than 'length'.