Re: GNOME CVS: glib jgarzik



On Sun, 24 Jan 1999, Tor Lillqvist wrote:
> Gnome CVS User writes:
>  > - Replaced "if (!hash_node) return;" with
>  > "if (hash_node) {do stuff}".
>  > Testing takes up less code space than explicit call to
>  > 'return' before end of function.  (look at gcc -S)
> 
> Hmm, is it worth it to sacrifice code clarity (presumably) for a
> alleged gain of some nanoseconds with one compiler, on one
> architecture?


IMHO clarity wasn't sacrificed.  And AFAIK all the asm dumps on x86,
SPARC, and Alpha are shorter when using a cmp/near-jump combo than when
using multiple return statements.  I've only timed it to be [slightly]
faster on x86, not yet on Alpha and SPARC.

	Jeff






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