]> git.lizzy.rs Git - rust.git/commit
enable parallel codegen by default
authorStuart Pernsteiner <stuart@pernsteiner.org>
Mon, 6 Oct 2014 23:59:21 +0000 (16:59 -0700)
committerPatrick Walton <pcwalton@mimiga.net>
Tue, 21 Oct 2014 21:46:16 +0000 (14:46 -0700)
commitc245c5bbad10923b47c9f66d5f0da2913ef11a38
tree28cbefd570454971b8196ab7c88dcf3246313365
parent4764c160119b375da8a816fcdc8fc1b1c44c1b1c
enable parallel codegen by default

Enable parallel codegen (2 units) by default when --opt-level is 0 or 1.  This
gives a minor speedup on large crates (~10%), with only a tiny slowdown (~2%)
for small ones (which usually build in under a second regardless).  The current
default (no parallelization) is used when the user requests optimization
(--opt-level 2 or 3), and when the user has enabled LTO (which is incompatible
with parallel codegen).

This commit also changes the rust build system to use parallel codegen
when appropriate.  This means codegen-units=4 for stage0 always, and
also for stage1 and stage2 when configured with --disable-optimize.
(Other settings use codegen-units=1 for stage1 and stage2, to get
maximum performance for release binaries.)  The build system also sets
codegen-units=1 for compiletest tests (compiletest does its own
parallelization) and uses the same setting as stage2 for crate tests.
mk/main.mk
mk/tests.mk
src/librustc/driver/config.rs