-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MyPaint slow/lagging once symmetry tool is enabled #883
Comments
Symmetry mode necessitates more work from the brush engine, that's just a fact of life. Q: does the laggy behaviour go away after the symmetry mode is turned off? I would normally suggest using a newer MyPaint, but I'm not sure that would really help you with this particular machine. Whoever tries to deal with this should probably have a look at DEBUGGING.md#Profiling to get started. |
Yes, the lag goes away when the symmetry tool is inactive again. |
For anyone looking at this, try turning on Debug-->Visualize Rendering. With symmetry mode active the bounding box for redrawing the dirty tiles becomes bigger as you move away from the center line. If you turn on horizontal and vertical the problem becomes exponential as you very quickly begin to redraw the entire screen. Ouch! I don't know how to begin fixing this. . . maybe make the brush engine return separate bounding boxes for each dab draw instead of one giant bounding box. |
Yep, the problem is indeed in the redrawing in MyPaint. libmypaint does not even break a sweat when rendering e.g. rotational symmetry with 50 rotational lines (unless the brush itself is heavy).
Not quite exponential, but a very nice visual example of quadratic complexity ;-)
Funnily enough, @jonnor suggested this in a comment in libmypaint/brushlib over 7 years ago, but I don't think it was ever implemented (no need at the time, I guess). At any rate, I implemented a naive version of multi-rectangle bounding boxes today, and while there is still some lag on fast strokes, it's a huge improvement for the new symmetry modes overall! Edit: With the separate rectangles, the bottleneck moves to the 16b->8b tile conversion function(s?) in lib/pixops.cpp (severity depending on the total area of updated regions that are visible in any viewport). Now that those tile conversions are a bit heavier (due to the eotf exponentiation), it might be worth implementing multithreading for that part of the rendering. |
The quadratic behavior is fixed with commits 0dd0de8 and mypaint/libmypaint@ec0447e The overall performance is still slower than it needs to be, due to the previously mentioned bottlenecks, but that is not related directly to the symmetry modes (the slowness of the mode is just a symptom of the way redrawing is handled). |
Actually, I just remembered that there still are performance issues related more closely to the symmetry mode. The fix I referenced above don't fix e.g. line mode being very slow when symmetry is enabled. Presumably the inking mode is just as bad. |
Description of the problem
Using MyPaint on a relatively slow RPi3 computer with a Wacom tablet works fine. Unless the user activates the symmetry tool. Once adding a symmetry line to the drawing, the drawing on the screen significantly lags behind the tablet pen movements.
Basic system details
MyPaint 1.2.0 on Raspbian Stretch (November 2017) using Raspberry Pi Desktop
Steps to reproduce
The text was updated successfully, but these errors were encountered: