Skip to content

[5.0] [String] ASCII fast-path for UTF16View #20900

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

5.0 cherry-pick of #20848

@milseman milseman requested a review from a team as a code owner November 30, 2018 02:51
@milseman
Copy link
Member Author

This includes a cherry-pick of #20899, otherwise we would conflict upon either of us being merged.

@milseman
Copy link
Member Author

@apple/swift5-branch-managers

  • Convergence

This adds important performance improvements to the ASCII strings which are bridged to Cocoa. This is a very frequent use case (identifiers, selectors, key paths, etc).

  • ABI impact

This has no ABI impact.

@milseman
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e782a0b67e4c698de6ca8a526fe7bd5a62823a33

Catfish-Man and others added 2 commits November 30, 2018 15:05
• Convert _AbstractStringStorage to a protocol, and the free functions used to deduplicate implementations to extensions on that protocol.
• Move 'start' into the abstract type and use that to simplify some code
• Move the ASCII fast path for length into UTF16View.
• Add a weirder but faster way to check which (if any) of our NSString subclasses a given object is, and adopt it

(cherry picked from commit 8b57921)
Add an isASCII fast-path for many UTF16View operations. These are
heavily utilized in random-access scenarios, allowing us to both be
more efficient and skip generating breadcrumbs for ASCII strings.
@milseman
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e782a0b67e4c698de6ca8a526fe7bd5a62823a33

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e782a0b67e4c698de6ca8a526fe7bd5a62823a33

@airspeedswift airspeedswift merged commit 7f14ddb into swiftlang:swift-5.0-branch Dec 1, 2018
@milseman milseman deleted the 5_0_ascii_hotness branch December 3, 2018 18:35
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