-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[4.2 04-30] Fixes for String performance regressions #16735
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
[4.2 04-30] Fixes for String performance regressions #16735
Conversation
Beside the general goal to remove inlinable functions, this reduces code size and also improves performance for several benchmarks. The performance problem was that by inlining top-level String API functions into client code (like String.count) it ended up calling non-inlinable internal String functions eventually. This is much slower than to make a single call at the top-level API boundary into the library. Inside the library all the internal String functions can be specialized and inlined. rdar://problem/39921548
Re-wrote the inner memcpy loops so that they can be vectorized. Also added a few inline(__always). Since we removed some @inlineable attributes this string-append code is not code generated in the client anymore. The code generation in the stdlib binary is different because all the precondition checks are not folded away. Using explicit loop control statements instead of for-in-range removes the precondition-overhead for those time critical memcpy loops.
|
@swift-ci test |
|
Explanation: These changes fix some major regressions, which were introduced with the new String implementation |
milseman
left a comment
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.
LGTM
|
Build failed |
|
Build failed |
[test] Update diagnostic test for SR-7599
|
@swift-ci test |
|
Build failed |
|
@swift-ci please test linux platform |
For details see commits.
rdar://problem/39978743