-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Don't grow smol Strings to 16 characters when bridging out if tagged pointer formation fails #84068
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
…pointer formation fails
|
@swift-ci please test |
|
@swift-ci please Apple Silicon benchmark |
| if _guts.isSmallASCII { | ||
| let maybeTagged = _guts.asSmall.withUTF8 { bufPtr in | ||
| return unsafe _createCFString( | ||
| if _guts.isSmall { |
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.
This is mostly just rearranging the code to be a bit clearer. The substantive change is is switching from grow + recursing into bridgeToObjectiveCImpl -> __StringStorage.create, which should let us create the actual size we want rather than unnecessarily padded.
|
15% or so win for ObjectiveCBridgeStubToNSString. Honestly better than I expected. |
|
docc failure is unrelated, will rerun tests once it's fixed |
|
@swift-ci please test macOS platform |
khamsukanon79120
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.
Thank you
Fixes rdar://159771498