-
How do I balance build parallelism with link parallelism? Let's say I have a desktop with 16 cores. My software application has 160 C++ source files, and it produces 64 linked binary executables (applications & tests). Normally, I build with If I use Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
ninja
tries to run as many processes as the number of available cores to maximize parallelism, with an assumption that each process is single-threaded. That assumption is incorrect for mold because mold is itself parallelized. Having more runnable threads than the number of cores is fine, as long as their total working set memory is smaller than the physical RAM size. If your machine grinds to halt due to memory oversubscription, you may want to try to set theMOLD_JOBS
environment variable to 1, so that only one mold instances is active. For more info, see https://github.com/rui314/mold/blob/main/docs/mold.md#environment-variables.