Bug 503696 - Krita Next nightlies have significant lag during undo/redo/canvas input when editing large files
Summary: Krita Next nightlies have significant lag during undo/redo/canvas input when ...
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: * Unknown (other bugs)
Version First Reported In: nightly build (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-03 02:04 UTC by Tyson Tan
Modified: 2025-05-28 03:58 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Old kritarc from 5.2.6 or even earlier (59.86 KB, text/plain)
2025-05-28 03:58 UTC, Tyson Tan
Details
New kritarc after resetting (37.52 KB, text/plain)
2025-05-28 03:58 UTC, Tyson Tan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tyson Tan 2025-05-03 02:04:23 UTC
In recent Krita Next nightly builds, I experienced significant lag when editing large files, especially during undo/redo actions or canvas input with modifiers like Ctrl/Shift. It takes 1 to 3 seconds for the software to respond to any new action different from my previous one.

For example, when I keep drawing brush strokes, everything works fine. However, as soon as I press any other key, Krita becomes unresponsive for a few seconds. If I undo and then redo actions, Krita freezes momentarily before responding. During this time, input is often lost, requiring me to press the shortcut multiple times for it to register.

I guess there's a regression in either the Undo/Redo or the Canvas input system.

Does not affect Krita 5.2.9.

Tested with krita-5.3.0-prealpha-7d6986ff4a-x86_64.AppImage

You can test this bug with this file:
https://tysontan.com/temp/spirited_20230228A_leiting_keyart_plus.zip

When I confirmed the bug, I hid all layers except one girl and used the red layer to detect transparency.
Comment 1 stuff 2025-05-19 12:13:07 UTC
Does this happen in canvas-only mode? More specifically, does it happen with all three of the Layers, Overview, and Histogram dockers closed?

I was trying to track down a similar issue where Ctrl+Z sometimes gets eaten/ignored (specifically, it fails to acquire a lock in KisDocument.cpp's undoImpl and gives up on undoing), and I think it might be the same or at least related to this.  I suspect that the reduced idle delay in 5.3 for thumbnail generation is causing that lock to get held earlier making ignored undos easier to trigger (I noticed holding ctrl+z wouldn't cause it, but tapping with a specific slower cadence would).  After raising the idle timeout in KisIdleTaskStrokeStrategy::preferredIdleWatcherInterval back up to 200ms from 50ms I haven't been able to reproduce my issue in my test case.

I also tried the provided file at 200ms and 50ms, and while the things I'm noticing seem better at 200 it's still not perfect (it still ignores undo while thumbnails are generating), but seems to act the same as 5.2.9.
Comment 2 Tyson Tan 2025-05-19 12:50:34 UTC
No, it happens all the time regardless of the UI arrangement.
Comment 3 vanyossi 2025-05-27 21:28:32 UTC
I am unable to reproduce this bug. Changing the undo settings made no difference. Tested on macOS and Windows Nightly.
Comment 4 Tyson Tan 2025-05-28 03:57:23 UTC
I tested this bug on Windows and couldn't reproduce it either. 
Based on my experience with Krita nightlies, I suspected a configuration issue.
After resetting my Krita configuration from the Settings menu, everything worked as expected. 

Since I typically use Krita with minimal configuration—just two shortcuts and panel positions—
I believe the newer version has introduced some compatibility issues with old kritarc versions.

I will attach the new and old versions of kritarc in later comments. 
Feel free to close this bug if you find it irrelevant.
Comment 5 Tyson Tan 2025-05-28 03:58:22 UTC
Created attachment 181808 [details]
Old kritarc from 5.2.6 or even earlier
Comment 6 Tyson Tan 2025-05-28 03:58:55 UTC
Created attachment 181809 [details]
New kritarc after resetting