saalfeldlab / paintera

GNU General Public License v2.0
99 stars 17 forks source link

Optimize orthoslice texture updates #396

Closed igorpisarev closed 4 years ago

igorpisarev commented 4 years ago

Fixes #395

The changes improve the performance quite a lot on my workstation and my laptop:

There is also another version of the fix that performs texture updates on a background thread: https://github.com/saalfeldlab/paintera/tree/optimize-orthoslice-textures-background-thread But the current state of that branch doesn't improve the performance much because of strict synchronization between the FX thread and the background thread. It should be possible to relax the synchronization, but it's more complicated and error-prone.

I'll merge and release the fixes in this PR, but I'll also keep the background thread version in case it turns out that the current fix is still slow in some circumstances.