mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
Consume multi-line comments faster. * Initially search for `*/`, `\r`, `\n` or `0xE2` (first byte of irregular line breaks). * Once a line break is found, switch to faster search which only looks for `*/`, as it's not relevant whether there are more line breaks or not. Using `memchr` for the 2nd simpler search, as it's efficient for a search with only one "needle". Initializing `memchr::memmem::Finder` is fairly expensive, and tried numerous ways to handle it. This is most performant way I could find. Any ideas how to avoid re-creating it for each Lexer pass? (it can't be a `static` as `Finder::new` is not a const function, and `lazy_static!` is too costly) |
||
|---|---|---|
| .. | ||
| examples | ||
| src | ||
| Cargo.toml | ||