Skip to content

MIR_borrow_checking and MIR_effect_checking are very slow #126440

Open

Description

I tried this code:

https://git.libre-chip.org/libre-chip/fayalite/src/commit/25aa90ec603acdc49a984588e75ba62d7f16b5c4

I expected to see this happen: compile in a reasonably short time

Instead, this happened:
running cargo +nightly rustc -p fayalite -- -Z time-passes gives small times for everything except:

time:  25.136; rss:  396MB ->  782MB ( +386MB)  MIR_borrow_checking
time:  22.335; rss:  782MB ->  973MB ( +191MB)  MIR_effect_checking

I'm running on a Ryzen 9 7950X so this isn't just a slow cpu.

Meta

rustc --version --verbose:

rustc 1.81.0-nightly (8337ba918 2024-06-12)
binary: rustc
commit-hash: 8337ba9189de188e2ed417018af2bf17a57d51ac
commit-date: 2024-06-12
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7

compilation is also quite slow on 1.79.0 stable, using RUSTC_BOOTSTRAP=1 cargo rustc -p fayalite -- -Z time-passes:

time:  24.300; rss:  389MB ->  768MB ( +379MB)  MIR_borrow_checking
time:  21.751; rss:  768MB ->  958MB ( +191MB)  MIR_effect_checking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-borrow-checkerArea: The borrow checkerArea: The borrow checkerC-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions