Skip to content

[5.1] [String] [Foundation] perf: UTF8 String -> Data #24239

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

ianpartridge
Copy link
Contributor

Cherry-pick of #24215 to swift-5.1-branch.

Currently, str.data(using:allowLossyConversion) always bridges via
NSString.

As String is now natively UTF8 we can fastpath this conversion in the
case where the user requests UTF8 encoding.

A benchmark for this was previously added in #22648.

Currently, `str.data(using:allowLossyConversion)` always bridges via
`NSString`.

As `String` is now natively UTF8 we can fastpath this conversion in the
case where the user requests UTF8 encoding.

A benchmark for this was previously added in swiftlang#22648.
@ianpartridge
Copy link
Contributor Author

@swift-ci please smoke test

@ianpartridge
Copy link
Contributor Author

CC: @milseman @Catfish-Man @itaiferber

@ianpartridge
Copy link
Contributor Author

@swift-ci please test

@itaiferber itaiferber merged commit f42c703 into swiftlang:swift-5.1-branch Apr 24, 2019
@ianpartridge ianpartridge deleted the 5.1-string-data-conversion-perf branch April 24, 2019 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants