Skip to content

[partitioning] Don't create CGUs below a certain size #47318

Closed

Description

@michaelwoerister

As a followup to #47316: Once we have a more accurate metric for CGU-size, we can also make sure to not sub-divide the program into smaller units than makes sense -- i.e. we don't want to have programs consisting of 16 one-function object files. We'd first have to find out concrete values for what is "too small" though. And I expect this to have little impact in practice. Consider it a mostly aesthetic improvement.

Activity

  1. michaelwoerister commented on Jan 22, 2018

    @michaelwoerister
    MemberAuthor

    I have no data to back this up but this might allow to reduce our bootstrap time because it would affect most test cases? cc @rust-lang/infra

  2. aidanhs commented on Jan 22, 2018

    @aidanhs
    Contributor

    Just to re-state to make sure i understand: the intention would be to speed up bootstrap, while avoiding the test slowdown seen in #44675 (comment) by avoiding splitting to ensure multiple codegen units don't penalise many tiny compiles?

  3. michaelwoerister commented on Jan 23, 2018

    @michaelwoerister
    MemberAuthor

    The hope would be that most test cases, which are usually small, would end up being compiled to just one codegen unit. As a result, compiling each test case would be faster because we are skipping unnecessary overhead that is introduced by splitting things into multiple CGUs.

    This could be tested by making compiletest set -Ccodegen-units=1 for run-pass for example. If that makes the test suite execute faster then the optimization proposed here could be tuned to do so too.

  4. aidanhs commented on Jan 23, 2018

    @aidanhs
    Contributor

    Sounds like the previous PR might be worth looking at again as low hanging fruit then, with this being a more robust solution.

  5. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Sep 20, 2018
  6. added
    C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing such
    on Oct 8, 2023
  7. Mark-Simulacrum commented on Jan 14, 2024

    @Mark-Simulacrum
    Member

    This seems to have been implemented:

    const NON_INCR_MIN_CGU_SIZE: usize = 1800;
    in #112448.

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-incr-compArea: Incremental compilationC-enhancementCategory: An issue proposing an enhancement or a PR with one.C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchT-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