These are not the only options that alter compile time, so does static/shared libgcc, BOLT (or not).
In my experience O3 and march=native are the big hitters. Sometimes different march flags negatively affect performance unexpectedly (e.g. avx512).
Also various of the settings end up conflicting / overriding each other IIRC, unless that has since been fixed it's possible the article is subtly mistaken. E.g. march=native and LTO and O3 conflicted with each other in this simple config mechanism when I've done this before.
Is AVX512 hitting poorly on microarchitectures that throttle?
If you aren't heavily and properly using AVX512 and your CPU downclocks when it sees an AVX512 instruction, the last thing you want is any AVX512 instructions...
I don't entirely understand which angle you're getting at, to be honest with you.
I have encountered throttling and downclocks even on small stints of avx512 instructions, on both consumer and server microarchictures. Hence why in my experience avx512 hurts compiler performance (and I said unexpectedly, because plenty of people think "avx512? Must be fast" without understanding the downclocking).
I was asking if it only is a problem on microarchitectures that throttle AVX512. Even the most recent chips still throttle, I was mostly curious if there's some other issue involved as well.
Both Zen4 and Zen5 handle avx512 incredibly well, iirc it doesnt throttle beyond an initial short freq dip which recovers quite fast but instead it just injects nops to keep the frequency
Ah, maybe. At work there are several reasons that tie us to Intel architectures for both prod and dev. I should reinvestigate since the build cluster I set up is on an AMD arch.
If you write a robust enough script (or dockerfile), you can make this fairly easy. All I've had to do recently is change a commit SHA/version tag in a --build-arg and it's just off to the races.
Especially useful in when upgrading the compiler and bisecting a behavior change.
As for MTPC: I will believe it when I see it. I've heard similar over the years for GCC, as well as in-TU caching for both GCC and Clang. It's years later and repeatedly nothing comes of it.
9
u/TheoreticalDumbass :illuminati: May 25 '26
while this is nice, i would love to see a more indepth comparison of the options here
in particular, this does PGO, LTO, O3 (IIRC gcc defaults to O2), march=native, bootstrapping, relaxed checks
i would love to see a table that compares all combinations of these, both "how long to build" and "how fast it is"
so that table would have 2^6 = 64 entries
i personally always disable bootstrap on my local builds of gcc, and would love to know what i am missing out on ๐
6
u/Supadoplex May 25 '26
That's just Gentoo with fewer steps.
2
u/_a4z May 25 '26
Have a look here, thatโs about a specialised build optimise gcc
https://youtu.be/X4pyOtawqjg?is=ycJdiiSpvV_d6HKm
0
u/[deleted] May 25 '26
[deleted] โ view deleted comment