We have been working on our project with scons as build system for a few years. Scons is awesome and has improved our development process a lot. There are ~15000 C++ source files initially and as the project evolves source files in other languages(Java/Scala) are added into the code base as well. Then we developed our own builders which manage dependencies and invoke the external tool(javac, scalac) to build those sources, which works really well. Recently I was working on the optimization of current build system and found performance difference between C++ and Java build process:
Environment setup:
Build server with 24 cores, Python 2.7.3, Scons 2.2.0
Command: scons --duplicate=soft-copy -j8
When building java code, CPU usage is easily high observed from top and spanning multiple cores: Java Build
However, when building C++ code, CPU usage is always ~4% and running only on 1 core no matter how many jobs in scons: C++ Build
I've been googling a lot on the internet but could not find something useful. Am I hitting the GIL issue in Python? I believe that each gcc/g++ command should be ran in a separate sub-process just like javac in our own builders, so there should not be GIL here. Is there any workaround to fully utilize multiple cores speeding up C++ build further? Thanks in advance.