Hi Ken,<div><br></div><div>The main issue with performance and IsNan() is more about how it is used than about whether it is inlined.  My guess is that Sean saw a performance hit because IsNan() was used inside vtkLookupTable, which has some of the hottest loops in all of VTK.  The IsNan() check was applied to all datatypes, even though it is not relevant for integer data.</div>


<div><br></div><div>I've patched vtkLookupTable so that it overloads vtkLinearLookup() and the IsNan check is only done on float and double.  The new code gives me a 40% speedup in color mapping a 16-bit image to RGBA.  The patch can be seen here: <a href="http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=1c348fcb" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=1c348fcb</a>.  I merged it directly into master.</div>


<div><br></div><div>There is also a function in vtkScalarsToColorsPainter that applies IsNan() regardless of scalar type.  It could benefit from a similar patch.</div><div><br></div><div> - David</div>