add parallel processing to PlotSignal()#72
Conversation
Little optimization, but gives ability to use Parallel.For loop
…el.For calculation plot points.
added button with Parallel calculation for testing
|
This is excellent! A great performance increase. Eventually there will be more parts of ScottPlot which may benefit from parallel processing. I added a plt.Parallel(true);What do you think of this solution? I agree this could use more testing, but since parallel processing is off by default I feel good about merging this with the master branch. |
|
Parallel.For works good on heavy loops with time computation say starting from seconds and gives nothing for milliseconds loops(Parallel.For overhead). Whole library fast enouth and get milliseconds for computations. One place is big signals then you get long min/max calculations, and its closed by SignalConst class. Log2(n) time insted of linear (n) time computation. It faster in most cases even if you make linear time ( n / (threadcount) ) with Parallel.For. |
|
Thank you so much @StendProg! I added an example of this to the cookbook: |
add parallel processing to PlotSignal()
Added RenderHighDensityParallel method to SignalPlot class.
Improve rendering speed for large signals.
Using parallel may slow render for small signals,
also may have some multithreading problems then updating signal, need lots of tests before accepted.
For PlotSignalConst gives nothing after fullLoad, i can't load cpu more then 25% with 60M signal.
This pull request more for testing, feel free to reject it.