oxc/crates/oxc_parser/src
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
..
js perf(lexer): dedupe numeric separator check (#3283) 2024-05-15 01:48:21 +00:00
jsx refactor(parser): simplify Context passing (#3266) 2024-05-14 12:22:27 +08:00
lexer perf(lexer): dedupe numeric separator check (#3283) 2024-05-15 01:48:21 +00:00
ts refactor(parser): simplify Context passing (#3266) 2024-05-14 12:22:27 +08:00
context.rs feat(parser): parse decorators properly (#2603) 2024-03-04 19:30:41 +08:00
cursor.rs refactor(parser): simplify Context passing (#3266) 2024-05-14 12:22:27 +08:00
diagnostics.rs refactor: run fmt 2024-05-12 01:20:41 +08:00
lib.rs refactor(parser,diagnostic): one diagnostic struct to eliminate monomorphization of generic types (#3214) 2024-05-11 04:56:22 +00:00
list.rs refactor(parser): wrapper type for parser (#2339) 2024-02-07 23:22:08 +08:00
state.rs refactor(ast): change Option<Vec> to Vec for decorators (#84) 2023-03-02 15:52:46 +08:00