Re: [Gimp-developer] gimp-plugin profiling



Well, I have a lot of if/then in code, but they are essential. So probably no opportunity here.

I will look on the links you provided anyway, thanks...



2013/3/11 Jon Nordby <jononor gmail com>

Yes, if you have branches in inner loops eliminating them can give
large speedups.
A quick google search gave this reference which looks like an OK start:
http://software.intel.com/en-us/articles/avoiding-the-cost-of-branch-misprediction
Less branching may also allow the compiler to auto-vectorize more.
If you are unable to remove the branches in your inner loop, you can
try to guide the branch predictor using
GCCs __builtin_expect: http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

Note that not just if/case statements introduce branching,
do/while/for do as well.

--
Jon Nordby - www.jonnor.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]