chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] two minor tweaks to runtime.c


From: Jörg F . Wittenberger
Subject: Re: [Chicken-users] two minor tweaks to runtime.c
Date: 27 Sep 2011 21:21:15 +0200

On Sep 27 2011, Peter Bex wrote:

On Tue, Sep 27, 2011 at 03:22:06PM +0200, Jörg F. Wittenberger wrote:
While I've been looking at the code I wondered if the C compiler
will fur sure pull that one test out of the for-loop.

Maybe it's better no have it there at the first place.
IMHO the code is not more confusing to read this way and should
run better in case the C compiler is not smart enough.

I'm firmly opposed to any such change that makes the code
much less readable for very little gain.

Please excuse me objecting.

IMHO the code is not less readable the rewritten way.
In fact - and so far it's a matter of taste - I would find it less
confusing.  (Let alone that it's fewer instructions.)

However I'm quite old school.  If I can tell the compiler something
and not rely on the compilers cleverness, I'll do so.  (And NOT do so
iff I want to create a test case for the compiler.)

In the case at hand I applied something which would have been typical
educational example in the late 70th: pull conditionals out of
frequently executed code if you can.



Is there anybody on the list who has a test case at hand, which would
exercise cons/list operations or initialisation code?  (Mine would be
suspicious in this case.)  Looking at "alternativ" compilers (besides
gcc) would be very nice.


The chance, which - depending on taste, would make the code either more
comprehensible or less - could have an actual effect.  That would be
the final argument in my case.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]