-
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
Long compile time due to excessively long translation passes #42941
Comments
This is where all the "actual" translation, i.e. MIR to LLVM, happens. But |
@bstrie shouldn't this be |
A much shorter replicating example (taken from #41696 (comment)) is: extern crate futures;
use futures::{future, IntoFuture, Future};
fn main() {
let t: std::result::Result<(), ()> = Ok(());
let f = t
.into_future()
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()))
.and_then(|_| future::ok(()));
f.wait();
} The code above takes ~750s to compile on my laptop (you can make it shorter/longer by removing/adding
The extra ~250s is again spent between Also maybe cc @arielb1 ? |
@jonhoo The extra 250 seconds you speak of is the translation to LLVM IR itself. Maybe we should make that list less confusing... |
@eddyb yeah, @michaelwoerister mentioned that above, I just figured it was worth repeating closer to the timing output. It's probably a good idea to have |
A few more data-points:
$ cargo +1.18.0 rustc -- -Z time-passes
...
time: 0.000; rss: 90MB borrow checking
...
$ cargo +nightly rustc -- -Z time-passes
...
time: 18.628; rss: 104MB borrow checking
... @eddyb is this worth nominating given that |
This looks like a duplicate of #38528? |
@sfackler yeah, that seems reasonable. |
Nominated the other issue and closing. |
@sfackler thoughts on the |
It's probably the MIR borrowck work -- @pnkfelix is aware of the problem, I believe. I'm not sure if we have an issue... |
Following up from #41696 (comment), I'm seeing compile times in excess of 13 minutes for a relatively simple program. In particular, running
cargo test --lib --no-run
on jonhoo/fantoccini@0802a57 takes ~925s on my laptop, as does even a simple program that uses the library in a similar way as the tests. The output of-Z time-passes
isThe gap in
is pretty curious. The extra time is spent between when
codegen unit partitioning
is printed and wheninternalize symbols
is printed, but not sure if that helps?The text was updated successfully, but these errors were encountered: