>CFLAGS="-Ofast -mmmx -mssse3 -pipe -funroll-loops -flto=8 -floop-block -floop-interchange -floop-strip-mine -ftree-loop-distribution"
Anything else is bloat
>CFLAGS="-Ofast -mmmx -mssse3 -pipe -funroll-loops -flto=8 -floop-block -floop-interchange -floop-strip-mine -ftree-loop-distribution"
Anything else is bloat
Other urls found in this thread:
godbolt.org
funroll-loops.teurasporsaat.org
harmful.cat-v.org
twitter.com
>redditfrog
dumb frogposter
>relying on the compiler to optimise your shitty code instead of just writing good code
>missing the point completely
At least enable CMOV and MOVBE and BMI2 you shit
why would you need anything more than
CFLAGS=-march=native -O2
and replace -O2 with -Os if you don't have a SSD.
Use march=native you fucking brainlet.
CFLAGS="-Osanic"
>-floop-interchange -floop-strip-mine
do you know what these do?
makes go fats
the ultimate redpill is -nostdlib
>mmx
>current year
lmao
how about manually unrolling them?
not like a dumb 100% but lets just say 2 times?
>having compilers installed on your computer
bloat
>what is march=native O3
O3 and Ofast are placebo
O2 is good enough and better tested
>funroll-loops
>anything else is bloat
objectively wrong
godbolt.org
O3 actually just enable several more optimizations but it can lead to instability.
-O3 (not to mention -Ofast) and especially -funroll-loops can actually slow down code often in practice, since they produce a larger executable that induces more cache misses. -O2 is a safe bet.
LTO on the other hand often shrinks the binary in practice without losing performance, making it a solid option to use, and I'm surprised they aren't recommended more. Graphite optimizations too can help, since they usually don't incur a performance/size tradeoff.
Not all packages build correctly with those options, however, so you need to be careful.
Agressive flags work, that's why clear Linux leads in all performance benchmarks.
>-O3
>not bloated as first
use -Os you moron
LTO doubles your compilation times.
Yeah, now benchmark that code
Pro tip: it's just the fucking same
>anything more than -O2 -pipe -march=native -mtune=native
gas all frogshitters.
You forgot --static there my son
Yes goy don't optimise your system stick to binary distributions
Why would unrolling loop be dangerous, wtf?
Sure it makes the executable bigger but how the fuck is it dangerous, dumb gentoofags.
dumb suckless poster
but does it increase the runtime performance?
>manually setting that shit
The compiler knows better than you. You should only set the optimization level plus maybe some optimizations like graphite, LTO and -fipa-pta.
>not using -static with clang+musl
>emits simd code
You're a dumb shit if you think it's going to be the same
What are the benefits?
A lot of C/C++ code has undefined behavior on some branches. Compiler might produce somewhat sane results of lesser optimization levels, but all bets are off at -O3/-Ofast
Static linking bloats my ram and my binaries with duplicate code. I dont want libc to be loaded (indirectly) into ram hundreds of times.
>fun roll
do people take the harmful nonsense from catv actually seriously? what the fuck...
>gcc manual says its unstable
>blames gentoo
ok
(((GCC)))
Enjoy your slow startup times and dll hell.
Fact: O3 will never, ever generate code that run slower than O2 for a standard-compliant program that doesn't rely on undefined behavior. If it does, it's a bug and you should use a better compiler.
Why are my binaries larger when I compile with LTO