Faster checking if a cell is visible
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.
A lot (~20%) of time is spent checking if a cell is visible. It is inside three nested for loops and therefore called many times. This overhead can be almost eliminated by directly accessing a pointer to the CellGhostArray.
I'm attaching a small benchmark showing the improvement. On my machine (Mid 2012 Mac Pro, XCode 6.4) the current implementation takes 0.16 seconds. This merge request reduces it to 0.008 seconds.