Skip to content

Commit a0954f7

Browse files
committed
Reduce the default number of CGUs for incremental.
Because it gives better performance.
1 parent ce5919f commit a0954f7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

compiler/rustc_session/src/session.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ impl Session {
12291229
// codegen units in order to reduce the "collateral damage" small
12301230
// changes cause.
12311231
if self.opts.incremental.is_some() {
1232-
return 256;
1232+
return 64;
12331233
}
12341234

12351235
// Why is 16 codegen units the default all the time?

config.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ changelog-seen = 2
434434
# compiler.
435435
#
436436
# Uses the rustc defaults: https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units
437-
#codegen-units = if incremental { 256 } else { 16 }
437+
#codegen-units = if incremental { 64 } else { 16 }
438438

439439
# Sets the number of codegen units to build the standard library with,
440440
# regardless of what the codegen-unit setting for the rest of the compiler is.

src/doc/rustc/src/codegen-options/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ also produce slower code. Setting this to 1 may improve the performance of
4040
generated code, but may be slower to compile.
4141

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

4545
## control-flow-guard
4646

0 commit comments

Comments
 (0)