[cfe-dev] Separate preprocess and compile: some performance numbers

Boris Kolpackov via cfe-dev cfe-dev at lists.llvm.org
Thu May 18 06:14:15 PDT 2017


Hi,

I have implemented the separate preprocess and compile setup in build2.
For Clang it is using -frewrite-includes (thanks to everyone's suggestions
in the earlier thread). I've also done some benchmarking:

https://build2.org/article/preprocess-compile-performance.xhtml

TL;DR for Clang:

Cost of a separate preprocessor run is less than 5% of a non-optimized
C++ build.

Interestingly, for GCC (with -fdirectives-only which does more than
-frewrite-includes) a separate preprocessor run is actually faster
(probably because of the time-localization of filesystem access).

Boris



More information about the cfe-dev mailing list