-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
perf regression in 2.7.9 #1009
Comments
@EmirVildanov do you think that can be optimized? Maybe the allocation can be removed if the token is &str instead of String? |
Alternatively we can perhaps have this better error reporting as a compile time or runtime option |
I am also noticed this slowdown. It's very noticeable in real-world situations. In a private development of branch rustray, I noticed this in the SBT2-parser (for ray tracer scene files). With pest version 2.7.9:
Downgrading to 2.7.8 yields:
So yeah, about 750% slower :-/ |
I'm guessing the main culprit may be |
Yeah, I'll profile the code and try to optimize it! |
I tried to reproduce it and indeed, there's a regression. In my setup (M1 CPU), it was approx. 50% faster than what @klensy posted:
but it's still a regression / around 5x slower than the previous version baseline. Without profiling, a few optimization ideas besides reducing the allocations:
But if optimizations can't bring the overhead down to be close to the previous baseline, I guess the best course of action may be to introduce a runtime |
* make tracking for better error details optional (fixes #1009) * Update pest/src/parser_state.rs * bump toolchain for msrv --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Describe the bug
Huge perf regression in 2.7.9, probably because of #965, visible in
http parser
andjson parser
benchmarksTo Reproduce
checkout 2.7.8 version of pest, cd grammars, cargo bench
checkout 2.7.9 version of pest, cd grammars, cargo bench
see the diff
Expected behavior
Not big regressions like here:
Additional context
One of probable slowdown spots?
pest/pest/src/parser_state.rs
Lines 1019 to 1021 in f60b518
The text was updated successfully, but these errors were encountered: