layer manangement speed

Dont know if this is the right place to ask or if it has been asked already
but for some reason, i find navigating the layers panel laggy.
its a problem I noticed both in 4.8 and 5.0 beta versions

i have 32gb of ram with the memory limit set to to 60%, swap undo at 7%
graphics acceleration enabled and set to Direct3d
8core intel i7, and nvidia gtx 1070
in Nvidia settings, I have vsync off, triple buffer off, max power management
I usually work on 4k canvases or a modified animation template 2258 x 1595 (1080p frame)
with number of layers varying between projects (4-10 for painting, upto 20 for animation)

but for some reason, switching what layer I’m working on and changing layer order
anywhere from 2-3 seconds to switch working layer or change layer order, even in small files with few layers.
most features run very fast and smooth for me, sometimes the color wheel and popup palette have some lag but the layer panel lag is consistent and bothers me more.

if its something that’s being worked on in the next update already, I look forward to it!
but in the meantime, is there any settings i could change, either in Krita or Nvidia, that would help?

Just out of curiosity, are you using Transformation Masks?

One of my older computers with Nvidia sometimes has heavy slow down moving layer order with transformation masks. I figured it is due to how old the pc is but maybe something else is at play too.

For the most part I don’t use them
On the occasions I have, the lag I experience is about the same as reordering regular paint layers, maybe a bit longer. This is something that seems to show up even on a fresh document swapping two empty paint layers.
If it is an NVidia problem, id want to know if there is any settings I could alter

I too sometimes have this, usually when I use any layer with effects turned on, even when it’s somewhere else in the stack and not actually the layer I was moving. Some masks too, like motion blur mask. However it kinda depends and doesn’t always happen.

I find the layer docker lag fairly consistent
lots of layers, or lots of effects it would make sense for there to be some lag, but not on a new file switching two empty layers.

Hi

I have this kind of problem, but on my side, it’s more it takes many minutes than couple of seconds :sweat_smile:

When it occurs, I just take a comics and start to read, waiting for operation is finished
Not sure that a good thing or not but… this give me the time to do another thing than using the computer :face_with_hand_over_mouth:

Grum999

I was just looking at that thread!
Oh man, an annoying couple seconds is one thing
but, i dont think i’d have the patience for a half hour!
A lot of layers and effects seems like it need a lot of processing power so i’d expect some lag time, but a half hour just seems excessive.

Whatever we are dealing with seems to be related, just different scales based off our workflows.

you mentioned multithreading, and if its related, could it be a problem with Krita not fully utilizing the cores we have?
looking at the resource manager to see individual core usage, it looks like whenever I change layer order, i see usage spike mainly on one core.
comparing it to Opentoonz/tahoma2d when moving layers around, there’s no spikes at all, and almost no lag in the canvas from moving layers.
a wild guess is the process is Krita is either using 1 core to process layer order, or not using all the cores efficiently leading to a spike in usage on a single core.
Id assume krita would be faster since it uses gpu rendering and Opentoonz doesn’t(or at least doesnt seem to use gpu rendering and lags a lot for me cause of it), so slow layer swapping would have to be related to cpu usage alone

When you don’t have the choice, you wait :slight_smile:

But I think the case I’ve reported in the topic is an extreme case.
It occurs for some documents only, and for some layers in the concerned documents. Fortunately, it’s not systematical.

I can’t really tell what happen for these documents, I think it’s a combination of many factor:

  • Number of nested layers
  • Transform masks
  • Layer style
  • Filters
  • Document size

Maybe other conditions are impacting, I never be able to really determinate what generate he problem neither when it start to happen.

For the usual couple of seconds you have, I never take care of it on my side :thinking:
But I just did some tests on simple document, and it’s instantaneous.

The graphic card won’t change anything, it’s only used for canvas (zoom, rotation, pan)
Not for computing image data.
In your case only CPU is used.

Some bugs impacting performances in UI has been fixed on animation with Krita 5.
But not sure they’ve an impact on non animated document.

I suppose all cores (CPU Limit) are used by Krita on your side?

I’m not really the best placed to talk about what Krita really does and how when a layer is moved.

But according to what I can see and understand, projection of all impacted layers are recalculated, Krita is using multithreading, and it use all available cores to recalculate projections:

  • Layers seems to be refreshed in parallel
  • For one layer (especially with style or a filter layer) multithreading is applied to recalculate projection on each tiles

Grum999

I have krita set to use all 8 cores on my computer, and i did a bit more digging for information on my end from my last post.

im not a programmer and probably not the best to talk about it either.

my own observations, just point to its the act of rearranging layers (and interacting in general) and at least for me, not as much to do with rendering. Maybe it is and I’m just not knowledgeable enough to know.
i did find this that kinda explains some stuff but a quite a bit is over my head.

what i could gather is that krita’s layer pixel info for rendering is stored hashtables,
each hashtable has its own read-write lock,
and waiting for the read-write lock is 40% of the wait time
and cpu threads waiting for the read-write locks to disable so they can process the next task can go to sleep instead of remain active.

it sounds like something that would impact layer rearranging speed.

So my new theory is its waiting for the read-write locks that makes it slow, and the more layers and effects and stuff, the more read-write locks you have to wait for.

but cause its from 2017, i dont know if its relevant any more

@dkazakov might be interested in this thread

idk if its the same problem
-hashtable and read-write lock stuff
it seems like it would be related,
i’m probably very wrong since i’m not a programmer by any means
i will add two things:

  • I had a lot of internet tabs open at the time of the glitch starting and did not exit them when recording,
  • and the glitch happened on other files before

https://drive.google.com/file/d/1ZjNge_c9UlaIe5M2uNkTZOSzJgBo3vSk/view?usp=sharing

edit:
may have had something to do with my nvidia settings, had power management changed to performance instead of optimal power, probably a mistake from messing with other settings trying to further improve Krita’s speeds. surprisingly did not impact layer panel performance.

I do not know if it is something that only happens to me but I have noticed that if you set the memory limit to more than 50% Krita becomes slow.

It’s something I discovered recently.

I havent found a difference myself when it comes to memory limit, except crashing if its set too low (less than 4gb, and 8gb if i’m animating)
setting nvidia to optimal power seems to have fixed the layer undo glitch for now, but for the most part it didnt really slow down.
and since layer management speed is based on cpu, it probably wouldn’t effect much.
gonna keep an eye on the speed though, hopefully when Krita 5 is out of beta, it’ll be solved

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.