fs: dispatch ASCII and Latin1 via simdutf in ReadFileUtf8 - #63370
fs: dispatch ASCII and Latin1 via simdutf in ReadFileUtf8#63370mertcanaltin wants to merge 1 commit into
Conversation
|
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
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 <[email protected]>
cdeaa76 to
deaa5e1
Compare
Sure, I applied now, new benchmark results: have a one regresion, I solving today, |
Signed-off-by: Mert Can Altin <[email protected]> PR-URL: #63370 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
|
Landed in 770385a |
Signed-off-by: Mert Can Altin <[email protected]> PR-URL: #63370 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Signed-off-by: Mert Can Altin <[email protected]> PR-URL: #63370 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
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