Am Dienstag, 27. September 2011, 20:42:54 schrieb Jaime Torres Amate: > before: 2984 calls to constBegin, 0,00%. 2960531 calls to constEnd, 2.33% > after: 2921 calls to constBegin, 0,00%. 2921 calls to constEnd, 0.00% > > before: calcDiversity, 55.83% (debug enabled) > after: calcDiversity, 14,46% (debug enabled) > > buildsycoca is still not faster than light, but it is only a four lines > patch.
>From a quick view: looks good. The trunkcate(sz) isn't needed AFAICT as matrix' size is never changed after the constructor so it already has this size. Ok, let's look on some other points: -the "register" inside the inner if's is superfluous, there is no place a function result could be stored between two function calls but in a register -from what I see the first branch iterates through the loop if pos is -1 and never does anything. -(-1)-1 is 0, and inside the loop it checks "pos != 0". Since pos can't change inside the loop it should be checked outside the loop so the whole iterating can be avoided at all. Or it could be merged with the first line of the function to immediately return 0. -the remaining register statement now is probably useless, too. The value is only preserved for very few instructions, so the compiler should already do this right. Hopefully. Eike
signature.asc
Description: This is a digitally signed message part.