Skip to content

Faster implicit function loop

We use the ParaView Slice View to visualize a vtkStructuredGrid. I profiled changing the slice position and found a small change that improves the response time.

Approximately half of the time spent calculating a vtkImplicitFunction over a vtkPoints object is spent retrieving the point value and storing the result in an array. This merge request uses direct array access to substantially reduce the amount of time spent in this loop.

I'm attaching a small benchmark showing the improvement. On my machine (Mid 2012 Mac Pro, XCode 6.4) the current implementation takes 2.7 seconds. This merge request reduces it to 1.4 seconds.

CMakeLists.txt FasterImplicitFunctionLoop.cxx

Merge request reports