Skip to content

[stdlib] Do a fast NFC check over the slice instead of guts #71481

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
merged 1 commit into from
Feb 19, 2024

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented Feb 8, 2024

When hashing strings/substrings, we do a fast nfc check over the slice to determine if we can skip normalization. Unfortunately this was asking the entire guts for its UTF8 buffer, instead of asking for its own UTF8 buffer. This caused us to iterate the entire base string instead of just searching the slice.

Resolves: rdar://122490088

@Azoy Azoy requested a review from a team as a code owner February 8, 2024 21:39
@Azoy
Copy link
Contributor Author

Azoy commented Feb 8, 2024

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Feb 8, 2024

@swift-ci please benchmark

@Azoy
Copy link
Contributor Author

Azoy commented Feb 8, 2024

@swift-ci please benchmark Apple Silicon

Copy link
Contributor

@Catfish-Man Catfish-Man left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg

@Azoy Azoy merged commit 1f4bdd4 into swiftlang:main Feb 19, 2024
@Azoy Azoy deleted the fast-nfc-check-fix branch February 19, 2024 23:19
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.

3 participants