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

Nico Weber via cfe-dev cfe-dev at lists.llvm.org
Thu May 18 07:29:45 PDT 2017


Did you just build once for each number? If so, disk cache effects will
make your measurements unreliable. I recommend doing 3 consecutive builds
for each number and then recording the smallest of these 3 numbers.

On Thu, May 18, 2017 at 9:14 AM, Boris Kolpackov via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> 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
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170518/34a9f9d0/attachment.html>


More information about the cfe-dev mailing list