Uh oh!
There was an error while loading. Please reload this page.
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.
nnethercote
commented
Jun 29, 2022
Local measurements indicate this won't affect any of the benchmarks in @bors try @rust-timer queue |
rust-timer
commented
Jun 29, 2022
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
bors
commented
Jun 29, 2022
⌛ Trying commit 687e391 with merge 4fa72b1548083b2d460e63e36e69b987970bc89f... |
bors
commented
Jun 29, 2022
☀️ Try build successful - checks-actions |
rust-timer
commented
Jun 29, 2022
Queued 4fa72b1548083b2d460e63e36e69b987970bc89f with parent 126e3df, future comparison URL. |
rust-timer
commented
Jun 29, 2022
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 |
nnethercote
commented
Jun 29, 2022
The only significant changes here are so small (< 0.3% on @bors rollup=always |
pnkfelix
commented
Jul 7, 2022
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 |
pnkfelix
commented
Jul 7, 2022
@bors r+ |
bors
commented
Jul 7, 2022
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