Skip to content

Commit 1f9b02b

Browse files
committed
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.
1 parent e8a76d8 commit 1f9b02b

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
@@ -255,6 +255,8 @@ def set(key, value):
255255
value = True
256256
elif keyval[1] == "false":
257257
value = False
258+
elif keyval[1].isdigit():
259+
value = int(keyval[1])
258260
else:
259261
value = keyval[1]
260262
set(keyval[0], value)
@@ -356,6 +358,8 @@ def to_toml(value):
356358
return '[' + ', '.join(map(to_toml, value)) + ']'
357359
elif isinstance(value, str):
358360
return "'" + value + "'"
361+
elif isinstance(value, int):
362+
return str(value)
359363
else:
360364
raise 'no toml'
361365

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)