For developing and debugging: -Og -g -Wall -pedantic -fcheck=all
For maximum performance once you have a functioning program, benchmark and test, but as a starting point look in the manual what -O2
, -O3
, -Ofast
, -ffast-math
, -funroll-loops
, -march=native
do. Be particularly careful wrt -Ofast
and -ffast-math
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…