-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Speed up compilation of type-system-chess
#114611
Conversation
And rename a closure argument.
Avoids lots of resizing as the set fills up.
These lines are the cause. They perform deduplication on obligation vectors. The vectors get enormous, the biggest are over 250,000 elements. The deduplication of these huge vectors is effective, typically removing more than half of the elements. |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 3c59e126ee8f731fb518af16ecafcb0746ae9431 with merge 78d71d60405cf6176f462492f3acea7134e818eb... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (78d71d60405cf6176f462492f3acea7134e818eb): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 631.452s -> 631.003s (-0.07%) |
This gives massive (~7x) compile time and memory usage reductions for the trait system stress test in rust-lang/rustc-perf#1680.
3c59e12
to
698f0e3
Compare
Perf results look good, various small improvements in secondary benchmarks. The real driver was the type-system-chess program I mentioned above, where the walltime and max-rss changes were both about -85% when I measured them locally. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a1e1dba): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 633.189s -> 633.173s (-0.00%) |
Is this likely to have a meaningful impact on other crates that produce a lot of trait obligations such as chumsky? |
|
Commit 8378487 from rust-lang#114611 changed the location of an obligation deduplication step in `opt_normalize_projection_type`. This meant that deduplication stopped happening on one path where it was still necessary, causing a couple of drastic performance regressions. This commit moves the deduplication back to the old location. The good news is that rust-lang#114611 had four commits and 8378487 was of minimal importance, so the perf benefits from that PR remain. Fixes rust-lang#116780, rust-lang#116797.
…piler-errors Fix a performance regression in obligation deduplication. Commit 8378487 from rust-lang#114611 changed the location of an obligation deduplication step in `opt_normalize_projection_type`. This meant that deduplication stopped happening on one path where it was still necessary, causing a couple of drastic performance regressions. This commit moves the deduplication back to the old location. The good news is that rust-lang#114611 had four commits and 8378487 was of minimal importance, so the perf benefits from that PR remain. Fixes rust-lang#116780, rust-lang#116797. r? `@compiler-errors`
Commit 8378487 from rust-lang#114611 changed the location of an obligation deduplication step in `opt_normalize_projection_type`. This meant that deduplication stopped happening on one path where it was still necessary, causing a couple of drastic performance regressions. This commit moves the deduplication back to the old location. The good news is that rust-lang#114611 had four commits and 8378487 was of minimal importance, so the perf benefits from that PR remain. Fixes rust-lang#116780, rust-lang#116797. (cherry picked from commit 91f2fbc)
Commit 8378487 from rust-lang#114611 changed the location of an obligation deduplication step in `opt_normalize_projection_type`. This meant that deduplication stopped happening on one path where it was still necessary, causing a couple of drastic performance regressions. This commit moves the deduplication back to the old location. The good news is that rust-lang#114611 had four commits and 8378487 was of minimal importance, so the perf benefits from that PR remain. Fixes rust-lang#116780, rust-lang#116797. (cherry picked from commit 91f2fbc)
type-system-chess
is an unusual program that implements a compile-time chess position solver in the trait system(!) This PR is about making it compile faster.r? @ghost