-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
An optimization for pest-2.1.3
#98654
Conversation
Because the `infcx` isn't needed. This removes one lifetime from `Search`.
Currently, `search_for_structural_match_violation` constructs an `infcx` from a `tcx` and then only uses the `tcx` within the `infcx`. This is wasteful because `infcx` is a big type. This commit changes it to use the `tcx` directly. When compiling `pest-2.1.3`, this changes the memcpy stats reported by DHAT for a `check full` build from this: ``` 433,008,916 bytes (100%, 99,787.93/Minstr) in 2,148,668 blocks (100%, 495.17/Minstr), avg size 201.52 bytes ``` to this: ``` 101,422,347 bytes (99.98%, 25,243.59/Minstr) in 1,318,407 blocks (99.96%, 328.15/Minstr), avg size 76.93 bytes ``` This translates to a 4.3% reduction in instruction counts.
Local measurements indicate this won't affect any of the benchmarks in @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 687e391 with merge 4fa72b1548083b2d460e63e36e69b987970bc89f... |
☀️ Try build successful - checks-actions |
Queued 4fa72b1548083b2d460e63e36e69b987970bc89f with parent 126e3df, future comparison URL. |
Finished benchmarking commit (4fa72b1548083b2d460e63e36e69b987970bc89f): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Footnotes |
The only significant changes here are so small (< 0.3% on @bors rollup=always |
I spent a little while trying to figure out why we were passing in an In the end, though, I couldn't find an answer, and I think that's okay. If it turns out we need |
@bors r+ |
Rollup of 4 pull requests Successful merges: - rust-lang#98533 (Add a `-Zdump-drop-tracking-cfg` debugging flag) - rust-lang#98654 (An optimization for `pest-2.1.3`) - rust-lang#98657 (Migrate some diagnostics from `rustc_const_eval` to `SessionDiagnostic`) - rust-lang#98794 (Highlight conflicting param-env candidates) Failed merges: - rust-lang#98957 ( don't allow ZST in ScalarInt ) r? `@ghost` `@rustbot` modify labels: rollup
An easy win I found while looking at a profile of
pest-2.1.3
. It's also a small code cleanup.r? @pnkfelix