Skip to content

Borrow checking time regression from stable to nightly #43018

Closed
@jonhoo

Description

@jonhoo

The compile time for the following code has increased significantly since the last stable:

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(()));
    f.wait();
}

Ignoring the fact that the translationphase takes forever (tracked in #38528), the borrow checking phase now takes orders of magnitude longer than on the last stable:

$ cargo +stable rustc -- -Z time-passes | grep "borrow checking"
time: 0.000; rss: 88MB  borrow checking                                                                                                                                                                                                                                      $ cargo +nightly rustc -- -Z time-passes | grep "borrow checking"
time: 1.173; rss: 101MB borrow checking

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions