letsfindaway / OpenBoard

I'm using this fork to contribute features and fixes to the upstream project. In order to create good pull requests, I'm rebasing my feature branches, squashing and reordering commits, etc. If you fork this repository be aware that my development branches may rewrite history without prior notice.
http://openboard.ch/
GNU General Public License v3.0
9 stars 0 forks source link

High CPU load with eraser #140

Closed letsfindaway closed 1 year ago

letsfindaway commented 1 year ago

Some people reported high CPU load when using the eraser. See http://openboard.ch/forum/viewtopic.php?f=8&t=5658. I can also reproduce that.

Using the profiler I can narrow down the problem to the parallel loop starting here: https://github.com/letsfindaway/OpenBoard/blob/8086ab90793a6bccd535665eeaf81765c93e73ed/src/domain/UBGraphicsScene.cpp#L1025

Most of the profiler's samples (92,2%) are in libpthread:start_thread. So I assumed that the overhead of multithreading is much bigger than the benefit. grafik

And in fact: commenting out the `#pragma omp' directives in this code solved the problem.

So I propose to remove these directives. The for loop has many iterations leading to many threads. But every iteration has only little to do. Parallelism is not a good approach for this situation.

@kaamui: Would this even be a candidate to go in 1.7.0?