perf: use simdutf8 to validate UTF-8 when reading files#2040
Merged
IWANABETHATGUY merged 1 commit intorolldown:mainfrom Aug 26, 2024
Merged
perf: use simdutf8 to validate UTF-8 when reading files#2040IWANABETHATGUY merged 1 commit intorolldown:mainfrom
simdutf8 to validate UTF-8 when reading files#2040IWANABETHATGUY merged 1 commit intorolldown:mainfrom
Conversation
✅ Deploy Preview for rolldown-rs canceled.
|
Member
|
I assume this would break our wasm and wasi builds without and feature target gates. |
Collaborator
Author
|
But it shouldn't break WASM anyway. |
928b189 to
4dbf02f
Compare
Member
|
We can always test the effect of such functionalities in oxc first, oxlint in this case. |
Collaborator
Author
|
Do oxlint's benchmarks include file IO? |
Member
I need to profile locally. |
Member
IWANABETHATGUY
approved these changes
Aug 26, 2024
Member
|
@Boshen since you assign to yourself, this pull request needs your approval to merge. |
Boshen
approved these changes
Aug 26, 2024
Collaborator
Author
|
I wasn't sure if this change also needs making elsewhere in Rolldown, if other parts of the code also read from file system. @IWANABETHATGUY can you advise? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
I'm not familiar with Rolldown's codebase, so I'm not sure whether this function is the main one used to read source text from files - so this may be in wrong place/not enough places.
std::fs::read_to_stringinternally callsstd::str::from_utf8to check that the file is valid UTF-8.str::from_utf8is not so efficient as it doesn't use SIMD.simduft8should be faster.I assume that this difference won't show up on benchmarks as they likely won't include IO. But I'd hope it'd have an effect in the real world. How would we go about testing that assumption? Are there any benchmarks which do exercise this function?