Skip to content

RUST-1798 use simd to optimize utf8 validation #548

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
Jun 3, 2025

Conversation

abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Jun 3, 2025

RUST-1798

Our string parsing has changed pretty significantly since #440 was opened, so I opted to create a new PR rather than try to rebase and rework that one.

Co-authored-by: Liyixin95 <601947961@qq.com>
@@ -44,7 +42,7 @@ pub enum ErrorKind {
MalformedValue { message: String },

/// Improper UTF-8 bytes were found when proper UTF-8 was expected.
Utf8EncodingError(Utf8Error),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error value provided by simdutf8::basic::from_utf8 is zero-sized (because it omits tracking error location in favor of speed) so I didn't see much reason to capture it here; this also means we're not exposing a 0.x crate type in our public API.

@abr-egn abr-egn marked this pull request as ready for review June 3, 2025 15:50
@abr-egn abr-egn requested a review from a team as a code owner June 3, 2025 15:50
@abr-egn abr-egn requested a review from isabelatkinson June 3, 2025 15:50
@abr-egn abr-egn merged commit f2c07cd into mongodb:main Jun 3, 2025
11 checks passed
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