[llvm-dev] Who wants faster LLVM/Clang builds?

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 6 08:53:39 PST 2017



> On Dec 6, 2017, at 12:45 AM, David Chisnall via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> On 5 Dec 2017, at 23:40, Mikhail Zolotukhin via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>> 
>> The list of files for which removing redundant headers improved compile time (the numbers are compile time in seconds for a Debug build):
> 
> A few comments:
> 
> First, your old and new numbers are giving time to a hundredth of a second, yet I generally see a variation of 0.1-0.2 seconds between runs.  How many times did you run each one and what is the Welch’s t-test delta?
> 
> Second, most of the changes are a few tenths of a second.  From the whole of your top 10, it looks as if you’re shaving around 3 seconds off the total build.  Presumably this is CPU time, so on a -j8 parallel build you’re saving under a second for something that takes a few minutes.  That doesn’t mean it’s not worth doing, but it does mean that if it has any impact on code maintainability then it probably isn’t.

I’m not arguing against any of your points, but also keep in mind that reducing #includes can reduce the number of files built in an incremental build when you change a header.

-Chris


> 
> Third, it’s not clear from your measurements whether you were doing a modules build or not.  The cost of redundant includes should be a lot lower if we’re using modules.
> 
> Finally, redundant includes can have a counterintuitive positive benefit on overall build times by warming the buffer cache (pulling in an include early when the dependency graph for the build is wide lets another compile job proceed while you’re waiting for disk, whereas pulling it in later when you’ve exhausted the parallelism in the build process causes a synchronous stall).  Did you measure the deltas in overall build time for a cold and warm disk cache after making these changes?
> 
> David
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list