mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
5f243d3c2b
This change tunes ahead-of-time codegening according to the amount of concurrency available, rather than according to the number of CPUs on the system. This can lower memory usage by reducing the number of compiled LLVM modules in memory at once, particularly across several rustc instances. Previously, each rustc instance would assume that it should codegen ahead of time to meet the demand of number-of-CPUs workers. But often, a rustc instance doesn't have nearly that much concurrency available to it, because the concurrency availability is split, via the jobserver, across all active rustc instances spawned by the driving cargo process, and is further limited by the `-j` flag argument. Therefore, each rustc might have had several times the number of LLVM modules in memory than it really needed to meet demand. If the modules were large, the effect on memory usage would be noticeable. With this change, the required amount of ahead-of-time codegen scales up with the actual number of workers running within a rustc instance. Note that the number of workers running can be less than the actual concurrency available to a rustc instance. However, if more concurrency is actually available, workers are spun up quickly as job tokens are acquired, and the ahead-of-time codegen scales up quickly as well.
37 lines
1.0 KiB
TOML
37 lines
1.0 KiB
TOML
[package]
|
|
authors = ["The Rust Project Developers"]
|
|
name = "rustc_codegen_ssa"
|
|
version = "0.0.0"
|
|
edition = "2018"
|
|
|
|
[lib]
|
|
test = false
|
|
|
|
[dependencies]
|
|
bitflags = "1.2.1"
|
|
cc = "1.0.1"
|
|
itertools = "0.9"
|
|
memmap = "0.7"
|
|
tracing = "0.1"
|
|
libc = "0.2.50"
|
|
jobserver = "0.1.11"
|
|
tempfile = "3.1"
|
|
pathdiff = "0.2.0"
|
|
|
|
rustc_serialize = { path = "../rustc_serialize" }
|
|
rustc_ast = { path = "../rustc_ast" }
|
|
rustc_span = { path = "../rustc_span" }
|
|
rustc_middle = { path = "../rustc_middle" }
|
|
rustc_apfloat = { path = "../rustc_apfloat" }
|
|
rustc_attr = { path = "../rustc_attr" }
|
|
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
|
|
rustc_data_structures = { path = "../rustc_data_structures"}
|
|
rustc_errors = { path = "../rustc_errors" }
|
|
rustc_fs_util = { path = "../rustc_fs_util" }
|
|
rustc_hir = { path = "../rustc_hir" }
|
|
rustc_incremental = { path = "../rustc_incremental" }
|
|
rustc_index = { path = "../rustc_index" }
|
|
rustc_macros = { path = "../rustc_macros" }
|
|
rustc_target = { path = "../rustc_target" }
|
|
rustc_session = { path = "../rustc_session" }
|