Long cook times related to "Laying out panel"

Hey there, I running into some lag with a project of mine. I have used the performance monitor to try and find the cause and I am getting an item that says “Laying out panel” with a path to a container that I use for UI. Some notes:

  • It occurs about every 30 - 60 seconds, seemingly randomly.
  • It occurs when I have that container open in window mode, but having the window open in perform vs open as separate doesn’t seem to change it.
  • The time I see in the performance monitor can be as little as 80ms to as high as 500ms.
  • The project runs smoothly outside of the random lag that I’m explaining.

I’ve attached a screenshot of a performance monitor grab I got. I read through the performance monitor documentation but not really sure where to go from here. Since it happens so randomly and only for 1 tick the probe component hasn’t been so helpful. Any insight into how I can further see what is causing the long cook time for laying out the panel?

I think this problem was happening a bit on the old build but since migrating my project over to the latest build it’s happening much more often and is more noticeable.

Thanks!! Screenshot below.