fs: dispatch ASCII and Latin1 via simdutf in ReadFileUtf8#63370
Open
mertcanaltin wants to merge 1 commit into
Open
fs: dispatch ASCII and Latin1 via simdutf in ReadFileUtf8#63370mertcanaltin wants to merge 1 commit into
mertcanaltin wants to merge 1 commit into
Conversation
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #63370 +/- ##
==========================================
- Coverage 90.07% 90.06% -0.02%
==========================================
Files 714 714
Lines 225564 225740 +176
Branches 42656 42718 +62
==========================================
+ Hits 203177 203306 +129
- Misses 14189 14221 +32
- Partials 8198 8213 +15
🚀 New features to boost your workflow:
|
addaleax
requested changes
May 18, 2026
Member
addaleax
left a comment
There was a problem hiding this comment.
Why would we make this change specifically for fs and not as part of the general ToV8Value() conversion or StringBytes?
Signed-off-by: Mert Can Altin <mertgold60@gmail.com>
cdeaa76 to
deaa5e1
Compare
Member
Author
Sure, I applied now, new benchmark results: have a one regresion, I solving today, |
lemire
approved these changes
May 18, 2026
Member
Author
addaleax
approved these changes
May 19, 2026
Collaborator
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.
In fs.readFileSync(path, 'utf8'), I dispatch the V8 string creation through simdutf. ASCII and Latin1-fits utf-8 use one-byte V8 strings, multibyte goes through simdutf to UTF-16, invalid utf-8 falls back to V8.
@nodejs/fs, @anonrig @addaleax, @lemire @mcollina
Bench results (gist): https://gist.github.com/mertcanaltin/a0096c3fad387d0bace821938754af44