about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-09-29 10:10:15 +0000
committerbors <bors@rust-lang.org>2017-09-29 10:10:15 +0000
commitd514263ce3b136775f6e8ec4b94cc1073d16c892 (patch)
treef36d34c88ac1e2a7695adf5d1bc6c432bbc98a17 /src/rustllvm/RustWrapper.cpp
parent0253d98382fa351d53880605a346d0ea2e941a07 (diff)
parent9e35b797b158d2e437bfee6376f852fd87861286 (diff)
downloadrust-d514263ce3b136775f6e8ec4b94cc1073d16c892.tar.gz
rust-d514263ce3b136775f6e8ec4b94cc1073d16c892.zip
Auto merge of #44853 - alexcrichton:debug-codegen-units, r=michaelwoerister
rustc: Default 32 codegen units at O0

This commit changes the default of rustc to use 32 codegen units when compiling
in debug mode, typically an opt-level=0 compilation. Since their inception
codegen units have matured quite a bit, gaining features such as:

* Parallel translation and codegen enabling codegen units to get worked on even
  more quickly.
* Deterministic and reliable partitioning through the same infrastructure as
  incremental compilation.
* Global rate limiting through the `jobserver` crate to avoid overloading the
  system.

The largest benefit of codegen units has forever been faster compilation through
parallel processing of modules on the LLVM side of things, using all the cores
available on build machines that typically have many available. Some downsides
have been fixed through the features above, but the major downside remaining is
that using codegen units reduces opportunities for inlining and optimization.
This, however, doesn't matter much during debug builds!

In this commit the default number of codegen units for debug builds has been
raised from 1 to 32. This should enable most `cargo build` compiles that are
bottlenecked on translation and/or code generation to immediately see speedups
through parallelization on available cores.

Work is being done to *always* enable multiple codegen units (and therefore
parallel codegen) but it requires #44841 at least to be landed and stabilized,
but stay tuned if you're interested in that aspect!
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions