Skip to content

Add appropriate resource set for Rustc codegen-units #3008

@UebelAndre

Description

@UebelAndre

https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units

This flag controls the maximum number of code generation units the crate is split into. It takes an integer greater than 0.

When a crate is split into multiple codegen units, LLVM is able to process them in parallel. Increasing parallelism may speed up compile times, but may also produce slower code. Setting this to 1 may improve the performance of generated code, but may be slower to compile.

The default value, if not specified, is 16 for non-incremental builds. For incremental builds the default is 256 which allows caching to be more granular.

If this is true, then by default, a single Rustc action consumes 16 CPU and should be reflected in Bazel's scheduling. An alternative is to force this value to be 1.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions