Skip to content

The compiler with debug assertions is really slow #121110

Closed

Description

@Noratrieb

The compiler compiled with debug assertions has gotten really slow recently. For example, compiling the standard library takes way longer than it used to.

This is bad, it makes it way harder to work on rustc.

Activity

  1. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to Rust
    on Feb 14, 2024
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 14, 2024
  3. changed the title [-]Compile with debug assertions is really slow[/-] [+]The compiler with debug assertions is really slow[/+] on Feb 14, 2024
  4. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 14, 2024
  5. Noratrieb commented on Feb 14, 2024

    @Noratrieb
    MemberAuthor

    This is probably because of the recent changes to assert_unsafe_precondition. It contains a cfg(bootstrap) hack for debug_assertions() that's not inlined. Additionally, it outlines the predicate, which is super slow as well. Fixing the former is easy, fixing the latter is harder and requires adding #[inline(not_the_mir_inliner)].

  6. added a commit that references this issue on Feb 14, 2024
  7. added 3 commits that reference this issue on Feb 20, 2024
    265ae67
    a3519ed
    4ff6bb5
  8. added a commit that references this issue on Feb 20, 2024
    a405cc6
  9. Noratrieb commented on Feb 20, 2024

    @Noratrieb
    MemberAuthor

    turns out this was caused by many different factors compounding in an unfortunate way :D
    oli's intrinsic changes outlining some important functions, and the unsafe preconditions being quite bad for runtime performance

  10. added 2 commits that reference this issue on Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-bugCategory: This is a bug.T-compilerRelevant 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