Profiling suggests that up to 40% of runtime is spent in updateSurfacePoint. We can get rid of the memory allocation for the buffer by introducing a buffer that persists between calls, either in the Patch class, globally in a namespace, or as an argument to the function. All possibilities should be benchmarked and considered w.r.t. code-complexity and one should be implemented. Note that the solution must be threadsafe since the updatreSurfacePoint is called from an omp-environment.
Profiling suggests that up to 40% of runtime is spent in updateSurfacePoint. We can get rid of the memory allocation for the buffer by introducing a buffer that persists between calls, either in the Patch class, globally in a namespace, or as an argument to the function. All possibilities should be benchmarked and considered w.r.t. code-complexity and one should be implemented. Note that the solution must be threadsafe since the updatreSurfacePoint is called from an omp-environment.