RE: Major speed hacks

On Mon, 2006-05-29 at 10:39 +0300, Dirk-Jan Binnema nokia com wrote:

> Maybe some further, micro optimizations:
> - G_UNLIKELY for the first 'if' might actually make sense here?
>    or move it to the end of the function. Even better, the 
>    caller should check and not invoke this function if cur == nth
> - The third 'if ( )' can  be left out.

Indeed, a cmp is faster than a jmp. So I shouldn't call the function if
I don't have to. I changed it a little bit.

Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be -

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