Bug 501932 - Krita 5.3.0 pre-alpha build 5790df09 : blending mode MEGA LAG bug
Summary: Krita 5.3.0 pre-alpha build 5790df09 : blending mode MEGA LAG bug
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Color models (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression, release_blocker
Depends on:
Blocks:
 
Reported: 2025-03-24 03:16 UTC by stephen
Modified: 2025-03-27 13:21 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stephen 2025-03-24 03:16:51 UTC
SUMMARY
For some reasons some blending modes like
the "Dissolve" mode, are UNBEARABLY LAGGY In THIS VERSION oF Krita

STEPS TO REPRODUCE
1. Put the "Dissolve" blend mode either on layer or soft brush
2. Paint with it on the canvas

OBSERVED RESULT
The canvas renders the result as an unbearably and
unexpected slow speed( can take up to two minutes and even more )

EXPECTED RESULT
No lag at all

SOFTWARE/OS VERSIONS
Windows 10 Pro

ADDITIONAL INFORMATION
( this issue is not present in Krita 5.2.2 nightly )
The issue might also affect some other blend modes.
I am not sure, but please double check if possible.
Comment 1 Dmitry Kazakov 2025-03-24 09:11:46 UTC
It seems like the bug is a regression from my refactoring in December
Comment 2 Dmitry Kazakov 2025-03-27 13:21:12 UTC
Git commit d211566997174204c611148941f8683399c76678 by Dmitry Kazakov.
Committed on 27/03/2025 at 13:20.
Pushed by dkazakov into branch 'master'.

Fix speed regression in Dissolve blendmode

When porting to Qt6 qrand() was directly replaced to
QRandomGenerator::global(), while the latter one uses a global
mutex inside, which makes Dissolve blendmode work extremely slow.
Hence we should use a local copy of a random generator to remove this
bottle-neck.

The bug was introduced by:
https://invent.kde.org/graphics/krita/-/commit/af99e90fa8a4dbbb98059c3c8a4d72daffbbda1d

M  +14   -2    libs/pigment/compositeops/KoCompositeOpDissolve.h
M  +4    -3    plugins/tools/basictools/kis_tool_multihand.cpp
M  +2    -0    plugins/tools/basictools/kis_tool_multihand.h

https://invent.kde.org/graphics/krita/-/commit/d211566997174204c611148941f8683399c76678