-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
1100% increase (!) in x86_64-unknown-linux release compile times #104842
Comments
Bisecting to a particular commit with https://github.com/rust-lang/cargo-bisect-rustc would help, and if you can provide a GitHub repository or similar that would also help (so we can reproduce). |
You could also profile the build with the |
Also, simple profiling with something like |
@Nilstrieb I've created a repository here with the profiling data obtained with -Ztime-passes and -Zself-profile: https://github.com/maxburke/rustc-104842 There are two directories, one for 2022-09-22 which doesn't exhibit the performance issue and 2022-09-23 which does @Mark-Simulacrum Unfortunately I'm not able to share the repository, but I will try bisecting to the affecting commit. |
@Mark-Simulacrum Bisected the performance regression to change |
Note that this means this regression will hit stable with 1.66, so rather soon, unless we end up with a backportable fix. |
This is reverted and backported on beta via #103509 -- if the current beta contains this PR and it's still slow, then I can investigate, but seems to be dealt with. |
Oh, hm, we should have reverted that PR on beta and nightly now. It would be great to see if we can verify it doesn't reproduce on beta perhaps? (Testing a more recent nightly would also be great). |
@maxburke do you mind checking on the latest nightly? edit: oh "Unfortunately other issues with toolchains have hindered us testing any further forward." Can you check that your beta tool chain is up to date and re-test? |
@compiler-errors I solved the issues we were getting with moving forward and after trying the latest nightly (2022-11-24), performance seems to be back to normal. |
…th-late-bound-vars-again, r=jackh726 Normalize opaques with late-bound vars again We have a hack in the compiler where if an opaque has escaping late-bound vars, we skip revealing it even though we *could* reveal it from a technical perspective. First of all, this is weird, since we really should be revealing all opaques in `Reveal::All` mode. Second of all, it causes subtle bugs (linked below). I attempted to fix this in rust-lang#100980, which was unfortunately reverted due to perf regressions on codebases that used really deeply nested futures in some interesting ways. The worst of which was rust-lang#103423, which caused the project to hang on build. Another one was rust-lang#104842, which was just a slow-down, but not a hang. I took some time afterwards to investigate how to rework `normalize_erasing_regions` to take advantage of better caching, but that effort kinda fizzled out (rust-lang#104133). However, recently, I was made aware of more bugs whose root cause is not revealing opaques during codegen. That made me want to fix this again -- in the process, interestingly, I took the the minimized example from rust-lang#103423 (comment), and it doesn't seem to hang any more... Thinking about this harder, there have been some changes to the way we lower and typecheck async futures that may have reduced the pathologically large number of outlives obligations (see description of rust-lang#103423) that we were encountering when normalizing opaques with bound vars the last time around: * rust-lang#104321 (lower `async { .. }` directly as a generator that implements `Future`, removing the `from_generator` shim) * rust-lang#104833 (removing an `identity_future` fn that was wrapping desugared future generators) ... so given that I can see: * No significant regression on rust perf bot (rust-lang#107620 (comment)) * No timeouts in crater run I did (rust-lang#107620 (comment), rechecked failing crates in rust-lang#107620 (comment)) ... and given that this PR: * Fixes rust-lang#104601 * Fixes rust-lang#107557 * Fixes rust-lang#109464 * Allows us to remove a `DefiningAnchor::Bubble` from codegen (75a8f68) I'm inclined to give this another shot at landing this. Best case, it just works -- worst case, we get more examples to study how we need to improve the compiler to make this work. r? types
Hi,
We've noticed a significant performance regression in compiling our top-level crate in release. It seems to have started as of nightly-2022-09-23:
With nightly-2022-09-22 the builds are significantly faster:
In trying to identify where this issue began we see that it's happening as far forward as 2022-11-14. Unfortunately other issues with toolchains have hindered us testing any further forward.
Compilation tests were done on an AMD 5950x (Ubuntu 22.04) with the following config.toml options:
We've seen a similar ratio in our CI builds (Azure F8s instances building in Ubuntu 20.04), but Apple M1 (aarch64 darwin) builds are unaffected.
The text was updated successfully, but these errors were encountered: