Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Question on performance



Paul Zimmermann wrote:

The problem in your example is not the inlining of the function nan2zero(). The problem is the function call isnan(). If you replace this function by a "x != x" then you will get a better performance which is close to the runtime without a call of nan2zero().

right, but Arnold's explicitly mentioned a call to isnan(x).

Only for lack of knowledge that x!=x executes much faster.
Can someone explain _why_ this is so?

Are the predicates isfinite(x) and/or isinf(x) also much slower than
an arithmetic operation? Can they also be replaced by something
costing next to nothing?


Arnold Neumaier