I originally added this problem onto Bug 421376, but after trying to diagnose it better I see differences in that bug to what I'm experiencing, so I'm creating a separate report.
Krita stutters two or three seconds after I complete a pen or mouse stroke. If I start a new stroke right away, the stutter will happen while I'm drawing. If I move the cursor across the canvas without drawing, the cursor will stutter as it moves, and any brush stroke after that is normal. When I complete that brush stroke however, the stutter cycle begins all over again.
This is not a memory issue. It occurs when there's well over 10 GB of memory free. It occurs with both pen tablet and mouse. It doesn't matter if Instant Preview is on or off. It also ONLY occurs in Krita. It doesn't happen in GIMP or any other program.
I'm experiencing this in the current beta, 4.4.3-beta1. It also occurred in 4.4.2.
I recently upgraded my Nvidia card from a Quadro 600 to a GeForce GTX 660. I'm not sure if the issue was happening before that, but it's become painfully more noticeable in the past couple of weeks, perhaps because I'm doing more detail work in Krita at the moment. The GeForce card, however, is the same card I used in my previous machine, and there were no problems with it up through November of last year when I switched computers. I updated the Nvidia drivers today and the problem still happens.
This stutter makes Krita rather annoying to work with. I've had to adjust my workflow to wait a few seconds after I complete a line before I start drawing another.
STEPS TO REPRODUCE
1. Draw a line.
2. Move the cursor after completing the line.
The cursor stutters after two or three seconds.
Languages: en_US, en
Version (compiled): 5.12.9
Version (loaded): 5.12.9
Build ABI: x86_64-little_endian-lp64
Build CPU: x86_64
Kernel Type: linux
Kernel Version: 5.10.21-200.fc33.x86_64
Pretty Productname: Fedora 33 (Cinnamon)
Product Type: fedora
Product Version: 33
Vendor: "NVIDIA Corporation"
Renderer: "GeForce GTX 660/PCIe/SSE2"
Version: "4.6.0 NVIDIA 460.56"
Shading language: "4.60 NVIDIA"
Requested format: QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CompatibilityProfile)
Current format: QSurfaceFormat(version 4.6, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CompatibilityProfile)
Supports deprecated functions true
is OpenGL ES: false
QPA OpenGL Detection Info
GPU Acceleration: auto
Memory: 24034 Mb
Number of Cores: 4
Swap Location: /tmp
Current Swap Location: /tmp
Current Swap Location writable: true
Undo Enabled: true
Undo Stack Limit: 30
Use OpenGL: true
Use OpenGL Texture Buffer: true
Use AMD Vectorization Workaround: false
Canvas State: OPENGL_SUCCESS
Autosave Interval: 900
Use Backup Files: true
Number of Backups Kept: 1
Backup File Suffix: ~
Backup Location: Same Folder as the File
Backup Location writable: false
Use Win8 Pointer Input: false
Use RightMiddleTabletButton Workaround: false
Levels of Detail Enabled: false
Use Zip64: false
Number of screens: 2
Resolution in pixels: 1920x1080
Manufacturer: HP Inc.
Model: HP VH240a-
Refresh Rate: 60
Resolution in pixels: 1920x1080
Manufacturer: LG Electronics
Model: LG IPS FULLHD
Refresh Rate: 60
As I worked in Krita today, I paid close attention to what was going on, and I now have a better idea of what's happening. It's not simply the pen or mouse stuttering, it's Krita itself freezing.
After completing a pen stroke, not only does the pen and mouse stutter, but it affects everything in Krita: rotating the canvas, zooming in and out, adjusting sliders in a toolbox, etc. The program itself freezes briefly.
There's another problem I've been having that I now believe is related to this as well. On occasion, after a pen stroke is completed, Krita freezes and remains frozen. The only way to unfreeze it is to save the file I'm working on.
I'm changing the title of this bug to reflect the new information.
The bug should be fixed now in Krita 5.0 with this commit:
Sadly, we cannot release an update for 4.x branch anymore, so the fix will be available only for 5.0 release that is still yet to be published.
The only workaround the issue in 4.x branch is to avoid keeping too many open documents open in Krita at the same time. Basically, the delay happens every time we try to update the memory consumption shown in the window title. And the delay in proportional to the amount of memory Krita consumes at the moment.
I'd noticed that the problem didn't occur when I only had two or three documents open, so I've been using the workaround you suggested. I'm glad that the issue was something you could fix and not a problem on my end. It's a very frustrating bug. I look forward to the release of 5.0. Thanks for all your hard work!
We are going to make a 4.4.7 release, just for the sake of fixing this bug :)
Awesome! Thanks, Dmitry! I look forward to it.