-
-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
4 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters