-
-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(parser): reduce work parsing regexps #1999
Conversation
CodSpeed Performance ReportMerging #1999 will not alter performanceComparing Summary
|
d4cf82f
to
efee37e
Compare
Damn it! This makes no difference whatsoever! Any idea why performance dropped slightly on #1926? Or was it just noise in the benchmarks? |
Any idea why performance dropped slightly on #1926? Or was it just noise in the benchmarks? Just noise. I forgot that regex has it's own standalone code path for getting the token, this PR is still good because it removes the weird re-parsing code from There is no perf different because this is such a minor code path, and probably there's only a few regexes in the benchmark. |
Thanks. One question: You said on #1926:
Was that a desired outcome, or a compromise you had to make to get it working? If the latter, I think the old behavior could now be restored after this PR by changing the oxc/crates/oxc_parser/src/lexer/mod.rs Lines 871 to 888 in aa91fde
|
A compromise. But leaving it as a hard error is also fine, I never had any rules for recoverability 😅 |
As discussed in #1999 (comment), this PR restores some of regex parsing behavior to as it was prior to #1926.
oxc-project#1926 produced a small performance regression because when parsing a regexp, some work is repeated.
As discussed in oxc-project#1999 (comment), this PR restores some of regex parsing behavior to as it was prior to oxc-project#1926.
#1926 produced a small performance regression because when parsing a regexp, some work is repeated.
Hopefully this PR may reverse it.
Perhaps implementation is a little messy, but posting it now as want to see what Codspeed says.