Skip to content

RAP-258 Use class based loop

Mark de Wever requested to merge RAP-258-improve-threading into master

The original code used a local ParallelFor variable. This caused a lot of threads to be created and destroyed causing a significant overhead. Instead the class contains the loop "variable". Based on André's suggestion the code now uses a StaticFor.

This only changes the steps specified in the original ticker. Other steps could be modified in a similar fashion.

The disadvantage of this approach is that every object creates set of threads that are kept alive during the execution of the application. Another appoach would be to use a global thread pool instead.

A measurement on DAS6 with 20000 timesteps gives the following timing results

  • Before: Total DP3 time 3019.5 real 3759.75 user 16238.7 system
  • After : Total DP3 time 574.73 real 1096.28 user 1687.25 system

(Before is the code using the separate write thread.)

Closes RAP-258

Edited by Mark de Wever

Merge request reports

Loading