Bug 430188

Summary: Extra "Updating..." stage after opening a large file and toggling layer visibility
Product: [Applications] krita Reporter: Yaroslav <OddMorning>
Component: Layer StackAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR Keywords: regression
Version First Reported In: 4.4.0   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Krita 4.3 behavior
Krita 4.4 behavior
Large file.kra

Description Yaroslav 2020-12-09 15:13:03 UTC
Created attachment 133955 [details]
Krita 4.3 behavior

1. Create a big .kra file with many layers
2. Close the file
3. Reopen the file and toggle a new or existing layer visibility

In Krita 4.3 and before, a layer toggles instantly.
In Krita 4.4.x, it shows the "Updating..." bar once.

It takes 40s to open my example file in both 4.3 and 4.4. But in 4.4 it can take extra 7s to "update" something at any moment: I may toggle a layer visibility in several minutes after starting drawing anything and it's a bit annoying.

It seems this "updating" stage is necessary but it would be so good if opening file would already include this stage (e.g. it would take 47s to open the file).
Comment 1 Yaroslav 2020-12-09 15:13:25 UTC
Created attachment 133956 [details]
Krita 4.4 behavior
Comment 2 Halla Rempt 2020-12-09 15:16:36 UTC
Could you share the actual file with us? If it's sensitive, please share it directly with vurian@gmail.com (my private email address).
Comment 3 Yaroslav 2020-12-09 15:43:15 UTC
Created attachment 133957 [details]
Large file.kra

Since the original file is really large (around 1GB) there's another one. But it still has the "updating stage".
Comment 4 Halla Rempt 2020-12-09 16:16:41 UTC
Thanks!
Comment 5 Halla Rempt 2021-09-08 09:01:59 UTC
I see that this happens with the first toggle of the top layer, afterwards, it's instant, also in Krita 5.1 pre-alpha. I'm not sure why this happens...

Marking as a regression, but not a release blocker.
Comment 6 Dmitry Kazakov 2022-04-13 14:25:35 UTC
Git commit ad3b02de8f8a3dd1b5d09146587a2ac37e2d5bc3 by Dmitry Kazakov.
Committed on 13/04/2022 at 14:25.
Pushed by dkazakov into branch 'master'.

Fix delay when when changing visibility of the layer on huge images

If an image has too many layers (e.g. 100+ layers), then calling
tightUserVisibleBounds() for all of them might be a bit too expensive.

And we call that because of the Shift+Click feature (which should
probably be deleted).

M  +5    -0    libs/image/commands/kis_node_property_list_command.cpp

https://invent.kde.org/graphics/krita/commit/ad3b02de8f8a3dd1b5d09146587a2ac37e2d5bc3