-
Notifications
You must be signed in to change notification settings - Fork 512
Description
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.