deno
50c5338d - perf(core): SIMD ASCII fast path for op_decode (#33720)

Commit
76 days ago
perf(core): SIMD ASCII fast path for op_decode (#33720) For pure-ASCII inputs (the dominant real-world case for `Response.text()`, `File.text()`, FormData parsing, `prompt()` input, etc.), short-circuit straight to `v8::String::new_from_one_byte` and skip both the BOM check and V8's internal UTF-8 validation pass. `v8::simdutf::validate_ascii` is a SIMD high-bit scan (~1 ns per 64 bytes); on non-ASCII inputs it bails at the first non-ASCII byte and falls through to the existing UTF-8 path. Same pattern as #33674 (which optimizes `ext/web`'s `op_encoding_decode_utf8`); this PR optimizes the parallel implementation in `deno_core`'s `op_decode`, which is the one used by all the body-decode call sites listed above.
Author
Parents
Loading