[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building Debian



On Wed, May 27, 2020 at 10:27:21AM +0200, Marek Mosiewicz wrote:
> Hello,
> 
> I have just two core machine, so I can not check it. But what I think
> GNU Make still not spawns only one process when compiling code.
> 
> In fact from my understanding of GCC there is no any objections to
> compile files in parallel. Compiler parses header files independently
> for each compilation unit so there is no any problem to spawn compiler
> on each core.
> 
> So building Debian on AMD Threadripper could be in theory 128 times
> faster.
> 
It isn't clear precisely what you are asking.  However, in general, GNU
make (and every other modern build system) allows you to specify a
parallelism level.  You can also use distributed compilers like icecc or
distcc to accomplish something similar.

However, note that from a theoretical perspective, achieving perfectly
parallel performance is practically impossible.  Suppose that you have a
build that contains 100 source files (50 .h files and 50 .c files) and
produces a single shared library.  

Header precompilation might be parallelizable to 50 threads and .c file
compilation might also be parallelizable to 50 threads in this case.
However, some .c files will have to wait on some .h files, based on the
project's dependencies, all of the files must be read from secondary
storage into RAM (don't forget about threads waiting on the system disk
to read/write), and at the end the linking step can only be performed in
a single thread.  A speedup of 25x in that case might be extraordinarily
good.

Regards,

-Roberto

-- 
Roberto C. Sánchez


Reply to: