Repository navigation
New solver opts for diesel (part 3) - #165160
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
New solver opts for diesel (part 3)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (4f26521): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -3.9%, secondary 3.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -1.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.2%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 484.843s -> 489.287s (0.92%) |
471be56 to
09ac7ab
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
New solver opts for diesel (part 3)
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (5018116): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -4.6%, secondary -1.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.8%, secondary -3.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 484.843s -> 482.182s (-0.55%) |
|
LLM disclosure: some of the optimization ideas came from LLM analysis. I wrote the code and text myself. |
|
|
|
cc @rust-lang/rust-analyzer Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
|
@bors rollup=iffy |
…zelmann New solver opts for diesel (part 3) A sequel to rust-lang#163981 and rust-lang#164234. These ones mostly relate to allocations. Details in individual commits. Local measurements: ``` solver icounts (B) ------ ----------- old 36.4 new (orig) 44.5 (1.22x) new (this PR) 42.4 (1.16x) ``` Also some small improvements on a range of other benchmarks. r? @jdonszelmann
…uwer Rollup of 7 perf-sensitive pull requests Successful merges: - #163339 (MIR move elimination [5/6]: Storage reconstruction) - #163525 (Move lang item collection to the resolver) - #163928 (do not prefer trivially true candidates with `-Znext-solver` ) - #164341 (Expand an early return case in `coerce_unsized`) - #164484 (Use adaptive sparse encoding for metadata tables) - #164607 (destringlyfy lint infrastructure) - #165160 (New solver opts for diesel (part 3)) > [!WARNING] > This rollup conflicts with pending auto build #165178 and may need to be recreated if the pending build succeeds.
…uwer Rollup of 7 perf-sensitive pull requests Successful merges: - #163339 (MIR move elimination [5/6]: Storage reconstruction) - #163525 (Move lang item collection to the resolver) - #163928 (do not prefer trivially true candidates with `-Znext-solver` ) - #164341 (Expand an early return case in `coerce_unsized`) - #164484 (Use adaptive sparse encoding for metadata tables) - #164607 (destringlyfy lint infrastructure) - #165160 (New solver opts for diesel (part 3)) > [!WARNING] > This rollup conflicts with pending auto build #165178 and may need to be recreated if the pending build succeeds.
…uwer Rollup of 7 perf-sensitive pull requests Successful merges: - #163339 (MIR move elimination [5/6]: Storage reconstruction) - #163525 (Move lang item collection to the resolver) - #163928 (do not prefer trivially true candidates with `-Znext-solver` ) - #164341 (Expand an early return case in `coerce_unsized`) - #164484 (Use adaptive sparse encoding for metadata tables) - #164607 (destringlyfy lint infrastructure) - #165160 (New solver opts for diesel (part 3)) > [!WARNING] > This rollup conflicts with pending auto build #165178 and may need to be recreated if the pending build succeeds.
This comment has been minimized.
This comment has been minimized.
We still use `ThinVec<I::GenericArg>` in `GoalStalledOn`, where the narrowness of the type is important. But using `Vec<I::GenericArg>` elsewhere is a perf win for `CanonicalizerState::variables`, which has `clone_from` called on it a lot. (`Vec::clone_from` is better optimized than `ThinVec::clone_from`.)
Returning requires `take`, which means the next user of `CanonicalizerState` has to allocate a new vec. `finalize` has two callers, but only one of them needs `variables`. This commit makes it so that single caller just clones the vec out of `CanonicalizerState` itself.
Currently, `InferCtxt` has a `CanonicalizerState` that gets reused by each canonicalizer. This gives a good amount of reuse, but we can increase it by moving the state to `GlobalCaches`. And we actually need a vector of `CanonicalizerState`, though it can only get multiple elements if we are using multiple threads.
`compute_query_response_instantiation_values_in_universe` computes an `opt_values` vector but then only sometimes consults the contents. This commit makes it lazy for a small perf win.
`CanonicalVarValues::instantiate` builds a `var_values` using a closure to generate each element. That closure is passed the under-construction `var_values`, which is unusual. This commit renames the parameters in the closures to `prev_var_values` to make this unusual behaviour more obvious. The commit looks bigger than it really is because of formatting changes.
09ac7ab to
d3dca22
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I rebased. @bors r=jdonszelmann |
Rollup merge of #165160 - nnethercote:diesel-opts-3, r=jdonszelmann New solver opts for diesel (part 3) A sequel to #163981 and #164234. These ones mostly relate to allocations. Details in individual commits. Local measurements: ``` solver icounts (B) ------ ----------- old 36.4 new (orig) 44.5 (1.22x) new (this PR) 42.4 (1.16x) ``` Also some small improvements on a range of other benchmarks. r? @jdonszelmann
…uwer Rollup of 2 pull requests Successful merges: - rust-lang/rust#165140 (More derive(Debug) cleanups for structs) - rust-lang/rust#165160 (New solver opts for diesel (part 3))
View all comments
A sequel to #163981 and #164234. These ones mostly relate to allocations. Details in individual commits.
Local measurements:
Also some small improvements on a range of other benchmarks.
r? @jdonszelmann