Skip to content

Commit

Permalink
Rollup merge of rust-lang#44675 - alexcrichton:many-cgu, r=aidanhs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexcrichton authored Sep 18, 2017
2 parents cfa32bf + 1f9b02b commit 91f3adf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ def set(key, value):
value = True
elif keyval[1] == "false":
value = False
elif keyval[1].isdigit():
value = int(keyval[1])
else:
value = keyval[1]
set(keyval[0], value)
Expand Down Expand Up @@ -357,6 +359,8 @@ def to_toml(value):
return '[' + ', '.join(map(to_toml, value)) + ']'
elif isinstance(value, str):
return "'" + value + "'"
elif isinstance(value, int):
return str(value)
else:
raise 'no toml'

Expand Down
4 changes: 4 additions & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
fi
else
# Let's try to take advantage of some of those sweet sweet parallelism wins by
# using multiple codegen units during the bootstrap
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-units=16"

# We almost always want debug assertions enabled, but sometimes this takes too
# long for too little benefit, so we just turn them off.
if [ "$NO_DEBUG_ASSERTIONS" = "" ]; then
Expand Down

0 comments on commit 91f3adf

Please sign in to comment.