upvote
> Never ever build in '-03 -march=native' by default. This is always a red flag and a sign of immaturity.

Perhaps you can see how there are some assumptions baked into that statement.

reply
What assumptions would that be?

Shipping anything built with -march=native is a horrible idea. Even on homogeneous targets like one of the clouds, you never know if they'll e.g. switch CPU vendors.

The correct thing to do is use microarch levels (e.g. x86-64-v2) or build fully generic if the target architecture doesn't have MA levels.

reply
The only time I used -march=native was for a university assignment which was built and evaluated on the same server, and it allowed juicing an extra bit of performance. Using it basically means locking the program to the current CPU only.

However I'm not sure about -O3. I know it can make the binary larger, not sure about other downsides.

reply
Not assumptions, experience.

I fully concur with that whole post as someone who also maintained a C++ codebase used in production.

reply
deleted
reply
> -march=native is always always a mistake

Gentoo user: hold my beer.

reply
It's also an option on NixOS but I haven't managed to get it working unlike Gentoo.
reply
Gentoo binaries aren't shipped that way
reply
>15000

15000 what?

reply
1500 C/C++ individual software components.

The 15000 was a typo on my side. Fixed.

reply
I see, thanks. I didn't mind the number it just wasn't clear what was it about.
reply