Skip to content

Comment on Compile your software

Comments

Other cool things you can do if you compile yourself is use features like auto parallelization[1].

I wouldn't recommend to enable it system wide because it causes issues with programs that fork() due to limitations in gcc's OpenMP library[2], but other than that it works pretty well. For example, I can fully load my 4C/8T CPU using 3 clang processes because compilation is magically spread over multiple threads. I've seen a "single threaded" program (qemu-img) suddenly start using more than a single core to convert disk images into other formats, leading to speedups.

Also things like PGO/FDO in combination with workload specific profiling data can easily give you 10% or more if you are CPU bound.

[1]: https://gcc.gnu.org/wiki/AutoParInGCC

[2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42624 (There was a patch to fix this, but it never got merged and doesn't apply to the current version any more, sadly)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.