Bug 410324

Summary: Delay in brushes and color picker when canvas RAM use is around 450MB and higher.
Product: [Applications] krita Reporter: Wontoon <WontoonRoo>
Component: OpenGL CanvasAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: major CC: halla
Priority: NOR    
Version First Reported In: 4.2.3   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Wontoon 2019-07-28 19:15:54 UTC
SUMMARY
When the RAM usage of a canvas starts exceeding around 450 MB of use, brushes larger than 100 pixels will begin to have a delay before the stroke appears on the canvas for the first stroke in a series of strokes (once you wait for a couple of seconds after a series of stroke, the delay appears again). The color picker will also consistently have a very noticeable ~2 second delay before it selects the color.

STEPS TO REPRODUCE
1. Create a new canvas.
2. Draw on it however you like. Add many layers and increase the size of the canvas, your goal is to use a decently high amount of RAM; 450+ will be your goal.
3. Set your brush size to 100+ px (It's oddly specific, as anything less works as normal).
4. You will begin to see the delay in your strokes and in the color picker.

OBSERVED RESULT
A delay in strokes in Krita with brushes larger than 100 px and the color picker.

EXPECTED RESULT
No delay with strokes.

SOFTWARE/OS VERSIONS
Windows: Windows 10

KDE Frameworks Version: 5
Qt Version: 5.12.4

ADDITIONAL INFORMATION

Hardware
CPU: Core i7 4770k
RAM: 16 GB
GPU: GTX 1050 Ti
Tablet: Cintiq Pro 16

Canvas info (when I first observed the bug): 4400 x 2600, 8-bit color integer depth, sRGB-elle-V2-srgbtrc.icc color space (default one)

Additional Notes:
The delay is completely absent when you zoom into the canvas. The delay does not exist in previous versions of Krita that I've used (but I have not used 4.2.2 and upgraded from 4.2.1 to 4.2.3). The delay also seems to be fairly consistent in length in between a test image of 450 MB and one I am working on for someone that is 1008 MB.

I tried several steps to resolve my issue (which all didn't), including changing the canvas rendering mode, restarting the system, closing other applications, updating Windows, and restarting the entire computer.
Comment 1 Wontoon 2019-07-29 06:07:13 UTC
Update: Turning off Instant Preview seems to remove the delay from the canvas strokes.

...huh, is Instant Preview doing the opposite of what it is supposed to be doing in this case?
Comment 2 Halla Rempt 2019-07-29 09:57:27 UTC
Instant preview works best for very large brushes on large images with fewer layers. But it works by keeping smaller versions of all layers around, and if you have a lot of layers, that takes a lot of time.

I'm not sure what to do with your report: you claim it's a regression, but I haven't seen that myself, and between 4.2.1 and 4.2.3 there hasn't been any changes to the way the image projection is calculated, and in general, it's not a bug in Krita if things get slow because the user uses krita in a way that is sub-optimal. But if this is really a regression, there's something we can investigate.
Comment 3 Wontoon 2019-07-29 14:13:19 UTC
Double-checked by going back to 4.2.1, and it definitely is there.

As I've never encountered this before I am going to take a wild guess and say that the setting was not enabled when I updated to the version when it was introduced, but when I updated but when I upgraded to 4.2.3 the setting defaulted back to "on". Either that or I somehow managed to completely dodge it with my more recent images up until now...somehow.

Either way, I'll mark this as "not a bug"/"I dun goofed" thanks for your time and I appreciate what you do!
Comment 4 Halla Rempt 2019-07-30 08:39:15 UTC
Thanks for helping investigate!