bug-gawk
[Top][All Lists]
Advanced

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

Re: gawk-5.1.1 bug report


From: Paul Eggert
Subject: Re: gawk-5.1.1 bug report
Date: Wed, 6 Apr 2022 09:54:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 4/6/22 03:28, Bernhard Voelker wrote:
Well, it was an argument to say that & eliminates a conditional execution
branch, but if both sides of the & operator have to be evaluated

They don't. Neither operand has side effects, so a compiler can evaluate either operand and not bother to evaluate the other operand if the evaluated operand is false.

Not that I expect compilers to do that in this particular case, as on today's processors it can be faster to evaluate both sides unconditionally. The hardware evaluates the two sides in parallel and this is way faster than a branch predictor miss.

calling the 2nd function is much more
overhead than the savings of & over &&, right?

No, as the functions are inlined so there is no function call overhead.



reply via email to

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