Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc: Default 32 codegen units at O0 #44853

Merged
merged 1 commit into from
Sep 29, 2017

Commits on Sep 26, 2017

  1. 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 rust-lang#44841 at least to be landed and stabilized,
    but stay tuned if you're interested in that aspect!
    alexcrichton committed Sep 26, 2017
    Configuration menu
    Copy the full SHA
    9e35b79 View commit details
    Browse the repository at this point in the history