oxc/crates/oxc_parser
overlookmotel 60a927d8f5
perf(parser): lexer match byte not char (#2025)
2 related changes to lexer's `read_next_token()`:

1. Hint to branch predictor that unicode identifiers and non-standard
whitespace are rare by marking that branch `#[cold]`.

2. The branch is on whether next character is ASCII or not. This check
only requires reading 1 byte, as ASCII characters are always single byte
in UTF8. So only do the work of getting a `char` in the cold path, once
it's established that character is not ASCII and this work is required.
2024-01-14 18:50:11 +08:00
..
examples chore(clippy): enable undocumented_unsafe_blocks 2023-10-16 15:18:14 +08:00
src perf(parser): lexer match byte not char (#2025) 2024-01-14 18:50:11 +08:00
Cargo.toml Publish crates v0.5.0 2024-01-12 23:33:47 +08:00