oxc/crates/oxc_parser
Don Isaac 508dae6f8f
perf(lexer): dedupe numeric separator check (#3283)
## What This PR Does

Updates numeric literal token lexing to record when separator characters
(`_`) are found in a new `Token` flag. This then gets passed to
`parse_int` and `parse_float`, removing the need for a second `_` check
in those two functions.

When run locally, I see no change to lexer benchmarks and minor
improvements to codegen benchmarks. For some reason, semantic and source
map benches seem to be doing slightly worse.

Note that I attempted to implement this with `bitflags!` (making
`escaped` and `is_on_newline` flags as well) and this caused performance
degradation. My best guess is that it turned reads on these flags from a
`mov` to a `mov` + a binary and.

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-05-15 01:48:21 +00:00
..
examples Make ast types covariant over the allocator lifetime. (#2943) 2024-04-12 18:12:18 +08:00
src perf(lexer): dedupe numeric separator check (#3283) 2024-05-15 01:48:21 +00:00
Cargo.toml Release crates v0.13.0 2024-05-14 23:14:15 +08:00
CHANGELOG.md Release crates v0.13.0 2024-05-14 23:14:15 +08:00