Skip to content

Improve vtkArrayCalculator's Performance

The function parsers used by vtkArrayCalculator now don't call Modified every time SetScalarValue/SetVectorValue is called, because when many threads are used, Modified is a communication overhead. Even when only one thread is used calling Modified very often is still a performance overhead. vtkArrayCalculator's functor now saves the arrays' size since they are constantly required. Also, instead of using 3 GetComponent, now only 1 GetTuple is used with a pre-allocate a temp tuple. Finally, Dispatch is used on the ResultArray instead of using the vtkDataArray::SetTuple.

For a Composite DataSet:

Before:

  1. 1 thread = 926.66 ms
  2. 8 threads = 1751.21 ms

After:

  1. 1 thread = 534.22 ms
  2. 8 threads = 98.55 ms
Edited by Spiros Tsalikis

Merge request reports