[llvm-dev] [cfe-dev] FYI: ENABLE_MODULES would make building faster
Vassil Vassilev via llvm-dev
llvm-dev at lists.llvm.org
Tue Jul 11 13:52:22 PDT 2017
On 10/07/17 11:44, NAKAMURA Takumi via cfe-dev wrote:
> I was testing efficiency with LLVM_ENABLE_MODULES to build clang/llvm
Thanks for sharing this summary.
> * Summary
> ** Efficiency of Modules increases as the degree of parallelism decreases.
> For example with -j8, Modules is 67% of elapsed time than no-modules.
Do you have some numbers about the performance if build with libstdc++?
> ** With higher parallelism, Modules is inefficient.
> For example with -j72, Modules is just 23 seconds faster than no-modules.
> Then, processor usage of Modules is about 55%.
> (Assuming (user+sys)/72 is ideal)
I assume this is the penalty of using implicit modules. Building modules
locks which might lead to quadratic compile times (we had an issue
describing the problem somewhere in bugzilla).
I've seen in the past using make that we build modules but we fail to
pick them up. I tried to fix the issue but didn't test thoroughly. If
you compile with -H you should probably see which files are still
> ** If each module(s) is not rebuilt, rebuilding is sufficiently efficient.
> For example with -j72 to remove just *.o, processor usage is 84%.
Do you mean we are 84% faster?
> * Random notes for improvements
> - Get rid of -DCLANG_ENABLE_(ARCMT|REWRITER|SATATIC_ANALYZER), =>
Thanks a lot for working on this!
> - Propagate definitions in unittests to whole the tree.
> Modules is sensitive of -D in command line.
> - Recognize CMake and Ninja to rebuild module cache.
> IIRC, there was the discussion about Fortran modules.
> - Parse and issue "module rebuilder" from modules.cache in advance of
> building the tree.
> Anyways, Ninja doesn't do anything while each compilation unit is
> waiting for module lock.
> I expect developers and users would be happier with Modules.
> Below, building clang with "/usr/bin/time ninja -jN clang"
> Host compiler is clang with libc++ and lld, -Asserts
> The host is Xeon 36 cores, 72 logical processors.
> Columns are;
> N, Number of jobs -jN
> user, user time (sec)
> system, system time (sec)
> elapsed, elapsed time (sec)
> Ideal:(u+s)/N, Ideal elapsed time w/o idle
> (Ideal/elapsed): Efficiency -- elapsed processor usage
> *ENABLE_MODULES_ON building to remove just *.o
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev