April 21st, 2005

philosophy, dialogues & conversations, heh

Optimizing Gentoo

Recompiling my system and world packages with -O2 instead of -O3 and -fomit-frame-pointer instead of -funroll-loops. See my posting on the Gentoo forums; according to my own notes in /etc/make.conf, I use these compile options because:

# *** See Gentoo forum “CFLAG Central”
# reduced -faligh-functions to 32, rasied from default 16 b/c 1024K L2 cache on Pentium-M
# -fforce-addr in conjuction with (-O2 implied) -fforce-mem kept operations in registers
# -rename-registers implied by -O3, as well as -finline-functions
# -funroll-loops kept since not implied by -Ox
# -funroll-loops removed because several posts indicate cache thrashing
# -fprefetch-loop-arrays improves perf of large, unrolled arrays
# -fomit-frame-pointer does not allow debugs
# -fomit-frame-pointer inserted as a replacement for unroll-loops since
# all forums indicate performance boost despite possible binary size increases
# -mfpmath=sse -mmmx, -msse implied by -march=pentium3 but kept for those
# configs that ignore -march=; remove these if package fails to build

I am considering adding LDFLAGS to the next world remake as primary replacement of #prelink :)