Skip to content

Commit 91f3adf

Browse files
authored
Rollup merge of #44675 - alexcrichton:many-cgu, r=aidanhs
ci: Use multiple codegen units on non-dist bots This commit is yet another attempt to bring down our cycle times by parallelizing some of the long-and-serial parts of the build, for example optimizing the libsyntax, librustc, and librustc_driver crate. The hope is that any perf loss from codegen units is more than made up for with the perf gain from using multiple codegen units. The value of 16 codegen units here is pretty arbitrary, it's basically just a number which hopefully means that the cores are always nice and warm.
2 parents cfa32bf + 1f9b02b commit 91f3adf

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/bootstrap/configure.py

+4
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ def set(key, value):
256256
value = True
257257
elif keyval[1] == "false":
258258
value = False
259+
elif keyval[1].isdigit():
260+
value = int(keyval[1])
259261
else:
260262
value = keyval[1]
261263
set(keyval[0], value)
@@ -357,6 +359,8 @@ def to_toml(value):
357359
return '[' + ', '.join(map(to_toml, value)) + ']'
358360
elif isinstance(value, str):
359361
return "'" + value + "'"
362+
elif isinstance(value, int):
363+
return str(value)
360364
else:
361365
raise 'no toml'
362366

src/ci/run.sh

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
5252
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
5353
fi
5454
else
55+
# Let's try to take advantage of some of those sweet sweet parallelism wins by
56+
# using multiple codegen units during the bootstrap
57+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-units=16"
58+
5559
# We almost always want debug assertions enabled, but sometimes this takes too
5660
# long for too little benefit, so we just turn them off.
5761
if [ "$NO_DEBUG_ASSERTIONS" = "" ]; then

0 commit comments

Comments
 (0)