|
|
Compile Flags
I do a lot of numeric (double precision floating point) programming, and
my experience is that the -O3 -ffast-math compile flag combination
consistently yields just about the best result. Be warned that
-ffast-math
takes some math shortcuts and does not follow all IEEE error-handling
conventions, so if you use this flag, you should verify your results,
especially if you need very high accuracy. My experience is that it
is well worth the speed boost to use this flag. I have seen on the
MinGW users mail archive that
-Os (optimize for small code size) can
also yield the best results in some cases, perhaps because it allows the
code to fit better into the CPU's L1 or L2 cache. I also prefer to
use the -Wall flag
to report all warnings. This is an excellent practice.
|
|
|
|
|