-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Removes redundant buffer zeroing in lowercased() and uppercased() by using `init(unsafeUninitializedCapacity:initializingWith:) #30895
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 test |
@swift-ci benchmark |
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
|
stdlib/public/core/String.swift
Outdated
output.baseAddress._unsafelyUnwrappedUnchecked, | ||
Int32(output.count), | ||
buf.baseAddress._unsafelyUnwrappedUnchecked, | ||
Int32(buf.count), |
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.
Nit: In general, the stdlib code base avoids ad-hoc abbreviations such as “buf” or “ret”; I realize some of these were not created by you, but ideally we wouldn’t introduce more.
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.
Renamed variables.
stdlib/public/core/String.swift
Outdated
&err)) | ||
initializedCount = min(len, uChars.count) | ||
if len > uChars.count { | ||
throw DummyError.dummy |
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.
Sorry, who catches this error? Does this code path represent a violation of an invariant or precondition?
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.
Rewritten without throwing.
This looks much better without the error throwing, thanks! |
@swift-ci benchmark |
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
|
ping |
1 similar comment
ping |
Can you squash the commits (except the one merging master)? Then let's kick off another test. |
809dcab
to
04e6373
Compare
done |
@swift-ci test |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@swift-ci test Linux platform |
This comment has been minimized.
This comment has been minimized.
@swift-ci smoke test Linux platform |
1 similar comment
@swift-ci smoke test Linux platform |
@swift-ci test Linux platform |
This comment has been minimized.
This comment has been minimized.
Let's see if this will do it: |
Build failed |
@swift-ci Please smoke test |
Removes redundant buffer zeroing in lowercased() and uppercased() by using `init(unsafeUninitializedCapacity:initializingWith:)