|
From: | Paul Eggert |
Subject: | Re: Using the GNU GMP Library for Bignums in Emacs |
Date: | Wed, 18 Jul 2018 14:42:13 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 07/18/2018 08:55 AM, Eli Zaretskii wrote:
Wouldn't calling this upon every float comparison yield a non-negligible run-time penalty? Maybe we should use 'isnan' instead?
No, it's actually faster (at least on x86-64), since it uses a single 64-bit integer comparison rather than up to three 64-bit floating-point comparisons. (The for-loop in question is unrolled into a single execution of its body, among other things.)
isnan would slow us down here, since the code does not need to differ for NaNs versus non-NaNs.
[Prev in Thread] | Current Thread | [Next in Thread] |