Hi, 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@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.
Regards, Nick
Le 30/03/2011 15:17, Nick Treleaven a écrit :
Hi, 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.
Agreed; and I'd also recommend it for on-time initializations.
Actually I removed some of them in the commit, but generally restored the it around NZV() since it had it included before. Maybe not very sensible, true.
Regards, Colomban
On 31 March 2011 00:17, Nick Treleaven nick.treleaven@btinternet.com wrote:
Hi, 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.
+1
Cheers Lex