Bug 438384 - Slowdown when nesting more than 5 Group Layers
Summary: Slowdown when nesting more than 5 Group Layers
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: 4.4.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-10 04:58 UTC by Tyson Tan
Modified: 2021-06-10 11:35 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 Tyson Tan 2021-06-10 04:58:15 UTC
Krita seems to slowdown significantly when nesting more than 5 Group Layers.

Steps to reproduce:
1) Create a new document,
2) Select a paint layer, Ctrl+G 6 times, so it's now nesting inside 6 group layers
3) Try draw something in the paint layer.

To me, the whole canvas stutter the moment when it hit the 6th nesting, the canvas become a checkerboard with some tiles of white and some tiles of transparency. All brush strokes after that was very choppy.

Tested under 4.4.5 and 5.0 nighties. Windows and Linux.
This is a bug relayed from the local community.
Comment 1 Dmitry Kazakov 2021-06-10 05:05:38 UTC
Theoretically, if all nested groups have only one layer without any custom blending, then it shouldn't do any delay. But it each group has more than one layer, then a significant delay is expected. 

I can reproduce the slowdown in the former case, so it looks like a valid bug. I'll check what happens there.
Comment 2 Dmitry Kazakov 2021-06-10 05:34:40 UTC
Okay, the slowdown happens due to too much contestion in KisGroupLayer::tryObligeChild()
Comment 3 Dmitry Kazakov 2021-06-10 09:13:50 UTC
Git commit fe2635ee8992b030e465cf33be278d2a0dcebf5a by Dmitry Kazakov.
Committed on 10/06/2021 at 09:12.
Pushed by dkazakov into branch 'master'.

Reduce contestion over oblidge-child routines in group layers

We shouldn't ask for projection() in group layers too often.

M  +25   -18   libs/image/kis_group_layer.cc
M  +1    -0    libs/image/kis_group_layer.h
M  +6    -1    libs/image/kis_layer.cc
M  +7    -0    libs/image/kis_layer.h

https://invent.kde.org/graphics/krita/commit/fe2635ee8992b030e465cf33be278d2a0dcebf5a
Comment 4 Tyson Tan 2021-06-10 11:35:30 UTC
Thank you, Dmitry! :D