I was a bit staggered today by the sheer number of auto generated includes that Boost produces when doing a compile if we turn on verbose includes. We’re averaging 3000 header files included per compilation unit and sometimes getting up to 5000. Virtually all of it is caused by Boost’s preprocessor-meta programming funk with large numbers of the same header file getting included again and again in a massive preprocessor recursion.
Do you think 3000 per compilation is normal for a Boost project? What can I do to optimise Boost builds other than buying an array of SSDs?
One thing that can really help is the use of precompiled headers, so that many or most of the Boost headers get compiled once for the whole build, not once for every translation unit.
Both Microsoft Visual C++ and GCC support precompiled headers (as do other compilers).