-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[4.2][String] Define _copyContents for UTF8View #16313
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][String] Define _copyContents for UTF8View #16313
Conversation
Define _copyContents on String.UTF8View, which allows it to efficiently memcpy bytes when the String is already in UTF-8 (or ASCII).
@swift-ci please test |
@swift-ci please smoke benchmark |
Build comment file:Build failed before running benchmark. |
@shahmishal is 4.2 branch benchmarking busted? |
@airspeedswift It's not supported yet. |
@shahmishal right, sorry, that was the more polite way of phrasing it :) |
edit: Nevermind, should of refreshed my browser. Thanks @shahmishal for clarification. |
@airspeedswift review? |
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. Is this getting covered by the current tests tho?
(aside from the benchmark it sped up, I guess) |
@airspeedswift I believe so, but just to make sure I'll break it and see |
Yes, this is extensively tested, both in the test suite as well as in StdlibUnittest itself |
Define _copyContents on String.UTF8View, which allows it to
efficiently memcpy bytes when the String is already in UTF-8 (or
ASCII).
Cherry-pick of #16245