oxc/crates/oxc_parser/src
Don Isaac 27030b9eb4
perf(lexer): use bitshifting when parsing known integers (#3296)
## What This PR Does

- perf(lexer): use bit shifting when parsing hex, octal, and binary
integers instead of `mul_add`-ing on `f64`s. Check out the difference in
assembly generated [here](https://godbolt.org/z/zMEKaeYzh)
- perf(lexer): skip redundant utf8 check when parsing BigInts
- refactor(lexer): remove `unsafe` usage (as per @overlookmotel's
request
[here](https://github.com/oxc-project/oxc/pull/3283#issuecomment-2111814598))
- test(lexer): add numeric parsing unit tests

I don't expect this PR to have a large performance improvement, since
the most common case (`Kind::Decimal`) is not affected. We could do
this, however, by splitting `Kind::Decimal` into `Kind::DecimalFloat`
and `Kind::DecimalInt` when the lexer encounters a `.`
2024-05-17 09:39:10 +08:00
..
js perf(lexer): use bitshifting when parsing known integers (#3296) 2024-05-17 09:39:10 +08:00
jsx refactor(parser): simplify Context passing (#3266) 2024-05-14 12:22:27 +08:00
lexer perf(lexer): use bitshifting when parsing known integers (#3296) 2024-05-17 09:39:10 +08: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