Earlier quoted context omitted.
Which is not parallelization. There's always the question of should I parallelize my compilation at the compiler level, or the build level (ie. Multiple translation units in flight). I think there's room for both, so you hopefully can get faster incremental compiles of a few number of TUs, but still have the old data level parallelization of multiple TUs.
From my observations multi-threading the linker would be more useful, since for small changes in bigger projects the linking step usually takes a lot longer than compiling a couple units.
Parallel GCC: a research project aiming to parallelize a real-world compiler
31–40 of 73 posts
Re: Parallel GCC: a research project aiming to parallelize a real-world compiler
#32There are so many tools to parallelize compilation, but comparatively little effort has gone into reducing the vast amounts of redundant work that compilers do. A staggeringly large percentage of compilation time is simply wasted duplicating work that was already done hundreds of times over. Tools like ccache are really primitive compared to what is possible. Change one bit in a header file and you have to recompile…
Re: Parallel GCC: a research project aiming to parallelize a real-world compiler
#33The use case is really niche. The only time it comes in handy is when: 1. You have enormous files AND 2. You have a little number of files.
Re: Parallel GCC: a research project aiming to parallelize a real-world compiler
#34The use case is really niche. The only time it comes in handy is when: 1. You have enormous files AND 2. You have a little number of files.
1. It can get extremely expensive in memory use. Your parallelism limit can be dictated by the memory your machine has. Spending your available cores over fewer simultaneous compilation units could also have benefits arising from data locality, even in situations where a machine's memory headroom isn't a concern.
2. Many large build processes have serialized steps which are currently unable to benefit from any form of parallelism. This is becoming even more the case with the rise of IPO & LTO.
But as ever, we'll probably have to wait to find out how large the practical benefits end up being from this work.
Re: Parallel GCC: a research project aiming to parallelize a real-world compiler
#35Earlier quoted context omitted.
Google has objfs, a authenticed network mounted drive that is an object file cache. Usually most of the tree has already been compiles so just your change needs to get recompiled and relinked. Further, there's then GOMA which is the distcc equivalent. I frequently build Android with 500 cores in the cloud. For that reason, I don't think Google engineers will ever focus on the compiler speed of llvm. That said, LLD (l…
Interesting. I searched for some more information on that but don't see anything except the GitHub repostoryitself. I wonder how would one go about integrating that into .Net stack.
(disclaimer: I'm an engineer on the Bazel team)
[1] https://docs.bazel.build/versions/master/remote-execution.ht...
Re: Parallel GCC: a research project aiming to parallelize a real-world compiler
#36Llvm already has one process per compile unit I believe.
Re: Parallel GCC: a research project aiming to parallelize a real-world compiler
#37On the other hand, maybe this project will help improve whole-program LTO link time. I see that is mentioned as future work for this effort:
> Parallelize IPA part. This can also improve the time during LTO compilations
Big kudos to Giuliano Belinassi, who seems to be the one driving this effort.
Re: Parallel GCC: a research project aiming to parallelize a real-world compiler
#38Llvm already has one process per compile unit I believe.
So at a project that I was working on one of the compilation units got so unwieldy that the last part of the build process was basically waiting for it alone to compile (it contained a lot of template instantiations). The solution was of course to manually "shard" it into several files even if semantically it didn't make much sense. Now, you might argue that it was our shitty code that caused this but surely this is…
It's sad these foundations only seem to exist in rust.
Re: Parallel GCC: a research project aiming to parallelize a real-world compiler
#39Earlier quoted context omitted.
That's great for super large builds, but the point of this is to deal with "I have one file I want to compile which is taking 30 seconds to compile, and I only have like three files to compile, so it would be awesome if I could use all of the cores on my laptop to do this compile and get it down to 10 seconds or something".
This, parti ularly for template heavy C++. Older versions of Stan on GCC 4.8 would take 60+ seconds to compile a single C++ file.
Re: Parallel GCC: a research project aiming to parallelize a real-world compiler
#40The use case is really niche. The only time it comes in handy is when: 1. You have enormous files AND 2. You have a little number of files.