[Geany-devel] G_(UN)LIKELY - Re: SF.net SVN: geany:[5625] trunk

Nick Treleaven nick.treleaven at xxxxx
Wed Mar 30 13:17:19 UTC 2011

I support Colomban's commit, but I think that these macros make
code hard to read. I therefore think we should only use them in places
where performance actually matters. If the time saving is probably under
a millisecond, we should not use them as it makes code harder to
understand. Save them for inner loops IMO.

On Thu, 24 Mar 2011 22:00:18 +0000
colombanw at users.sourceforge.net wrote:

> Revision: 5625
>           http://geany.svn.sourceforge.net/geany/?rev=5625&view=rev
> Author:   colombanw
> Date:     2011-03-24 22:00:18 +0000 (Thu, 24 Mar 2011)
> Log Message:
> -----------
> Improve usage of G_(UN)?LIKELY()
> G_(UN)?LIKELY() should be only used on whole conditional expressions,
> and only if the branching is very highly predictable, not if it is only
> more probable.
> These macros should be used with care because a wrong prediction may
> be a lot worst than what a good prediction can give.


More information about the Devel mailing list