KHTML-Measurement (from my talk at aKademy)

Arend Bayer arend.bayer at web.de
Fri Aug 27 18:39:00 CEST 2004



> There's a way to help branch prediction without writing assembly code though...
> See KDE_ISLIKELY and KDE_ISUNLIKELY in kdemacros.h (they use __builtin_expect from gcc)
> 

Quote from the gcc info pages:
     In general, you should prefer to use
     actual profile feedback for this (`-fprofile-arcs'), as
     programmers are notoriously bad at predicting how their programs
     actually perform.

I found this to be quite true in my own experiments in my own (very
performance sensitive) project. Note that you have to better then the
CPU branch prediction, which seems usually very good.

It's something which might be worth doing once you worry about squeezing
out the latest percent of performance.

Arend



More information about the Kde-optimize mailing list