Denis Oliver Kropp wrote: > Bin Chen wrote: >> 在 2007-10-16二的 09:23 +0200,Denis Oliver Kropp写道: >>> Phil Endecott wrote: >>>> I've also noticed that djpeg runs about 15% faster if compiled with -Os >>>> rather than -O4. >>> On x86? >>> >>> On embedded architectures, -O2 is often better than -O3, but if you have >>> a very small instruction cache, -Os could be best. >> Its interesting, why -O2 is better? > > O3 can produce code (loop unrolling etc.) where the cache penalty is > bigger than the speed improvement.
Also, if you need maximum performance for one function you could put it into a separate C file and do benchmarks with various compiler options to build the file (function) with the best you could find. -fnew-ra gave me 5-10% increase once! -- Best regards, Denis Oliver Kropp .------------------------------------------. | DirectFB - Hardware accelerated graphics | | http://www.directfb.org/ | "------------------------------------------" _______________________________________________ directfb-dev mailing list [email protected] http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev
