Skip to content

[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

Merged

Conversation

milseman
Copy link
Member

@milseman milseman commented May 2, 2018

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

Define _copyContents on String.UTF8View, which allows it to
efficiently memcpy bytes when the String is already in UTF-8 (or
ASCII).
@milseman milseman requested a review from airspeedswift May 2, 2018 18:56
@milseman
Copy link
Member Author

milseman commented May 2, 2018

@swift-ci please test

@milseman
Copy link
Member Author

milseman commented May 2, 2018

@swift-ci please smoke benchmark

@swift-ci
Copy link
Contributor

swift-ci commented May 2, 2018

Build comment file:

Build failed before running benchmark.


@airspeedswift
Copy link
Member

@shahmishal is 4.2 branch benchmarking busted?

@shahmishal
Copy link
Member

@airspeedswift It's not supported yet.

@airspeedswift
Copy link
Member

@shahmishal right, sorry, that was the more polite way of phrasing it :)

@milseman
Copy link
Member Author

milseman commented May 2, 2018

It seems so, after a successful run:

15:05:39 Unable to find benchmark logs for master branch. Set a baseline benchmark log by passing --benchmark to build-script while on master branch.

edit: Nevermind, should of refreshed my browser. Thanks @shahmishal for clarification.

@milseman
Copy link
Member Author

milseman commented May 3, 2018

@airspeedswift review?

Copy link
Member

@airspeedswift airspeedswift left a 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?

@airspeedswift
Copy link
Member

(aside from the benchmark it sped up, I guess)

@milseman
Copy link
Member Author

milseman commented May 3, 2018

@airspeedswift I believe so, but just to make sure I'll break it and see

@milseman
Copy link
Member Author

milseman commented May 3, 2018

Yes, this is extensively tested, both in the test suite as well as in StdlibUnittest itself

@milseman milseman merged commit fde046f into swiftlang:swift-4.2-branch May 3, 2018
@milseman milseman deleted the 4_2_utf8_view_copy_contents branch May 3, 2018 20:06
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.

4 participants