ScreenGui performance: One vs. Many

I’m looking into optimizing the interface of my game. Currently, updating any element inside the single ScreenGui heavily lowers the framerate. This is especially noticeable when tweening the position of a GUI element.

Would it be more efficient to use a ScreenGui for each section of the interface so that the rendering is only updated for a section when its content changes?

If not, what can be done to optimize things other than reducing the usage of the TweenService?

I’m aware this is something I can try myself, but it’s a big task to take on at this stage in development so I’d like to hear developer feedback on this subject.

Thank you!

3 Likes

I’ve never really experienced FPS drops with the UI, unless when I used many Viewport Frames with moving parts in them.

As for optimizing them:

  1. You can :Destroy() permanently unneeded ScreenGUIs and hide temporary unneeded ones (I think hiding would affect the performance in a good way, but don’t take my word on that).
  2. If you really want to go that extra mile, you can avoid using images for buttons and instead use the normal rectangular ones. Loading and rendering images/textures also takes up memory, and increases CPU and GPU usage.
  3. I am pretty sure that limiting the amount of scrips can decrease lag, ever so slightly. But that change is so, so small that it’s probably not worth it.
1 Like

Using one UI with divided folders is imo the cleanest way to setup a UI. There are no performance differences that I know of it is just cleaner in studio.

Yes, separating your ui into multiple ScreenGuis can improve performance.

Seperate large parts of the UI into different screen guis, but obviously don’t overdo it.

11 Likes

I knew my memory wasn’t playing tricks on me. Thank you for this!

2 Likes