GCC Automatic Parallel Compilation Viability Results Help Up To 3.3x

Written by Michael Larabel in GNU on 3 September 2020 at 12:02 AM EDT. 5 Comments
GNU
One of the most interesting projects out of Google Summer of Code 2020 has been the ongoing work for allowing individual code files to be compiled in parallel, building off work last year in addressing GCC parallelization bottlenecks. The final report for GSoC 2020 on this work has been issued.

This work has been focused on being able to parallelize the compilation of large source files compared to traditionally with making use of multiple jobs from the build system for compiling multiple files in parallel. For large source files and further enhancing GCC parallelization abilities is a big win in an era of increasing core/thread counts.

Student developer Giuliano Belinassi was successful in his work and ended out the summer re-basing his patches for ideally seeing merging to trunk in the near future. In the end he found the project led to speed-ups ranging from 0.95x to 3.3x. The work is deemed ready at least in an experimental state.

A GCC branch is available (autopar_devel) with the staged code. When wanting to test compiling a file in parallel with that patched compiler, the "-fparallel-jobs=" flag can be used for specifying the number of parallel jobs.

As for the GSoC 2020 project conclusion, it highlights future work that could be done to improve the GCC compilation time on systems with large core counts:
This project can still be improved on a lot of places. For example, just by looking at the table above, we can conclude that:

* Promoting statics to globals can increase parallelism opportunity on compilation.
* Even with the IO Streaming overhead, the LTO Emulated Parallelism was faster than with our method. This means that either our partitioner is slow or we are losing time into something which can be improved.
* This can be used as a way to reduce overall compilation time in many-core machines.

See the full report for those interested in this topic. Hopefully Belinassi will continue on contributing to the GNU Compiler Collection given his successes now over the past two summers.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week