Optimizing Widget/ Slate Performance

Hi,

Were currently trying to heavily optimize CPU performance in our game and we noticed that the SlateTickTime is always very unperformant.

We were taking a look at lyra as an example and noticed similar issues here.

Slate is always a huge tick time and it cannot be disabled with eg. not ticking the widgets themselves.

Taking almost 1/16 of our frame budget on the cpu seems overkill for just drawing a few widgets on the HUD.

Since i didnt find a lot of ressources about this i wanted to ask how to optimize the UI / HUD properly.

Would be very nice if we could get an example how fortnite or other commercial projects are doing this performant.

Thanks in advance.

[Attachment Removed]

Steps to Reproduce
Open lyra, profile the SlateTickTime.

It will be around 700 microseconds on a very good CPU.

[Attachment Removed]

Hi there,

I’ve collated a few resources here into a list. Some of them you are likely aware of. However I do think they’re quite valuable so they’re worth including:

The general idea covered in these resources is 1. Reduce Draw Calls, 2. Reduce Per-Frame calls. They do a great job of explaining these however I will go over some of them.

If you want to reduce the number of draw calls you should look into using Invalidation Boxes & Retainer Panels. https://dev.epicgames.com/documentation/en-us/unreal-engine/invalidation-in-slate-and-umg-for-unreal-engine These both have their own pros & cons but used If used correctly they can drastically reduce the amount of draw calls required.

Additionally you can use the “Slate.EnableGlobalInvalidation” CVar to activate global invalidation for your entire UI. This Could be risky depending on how your widgets are set up. However Enabling it in a Lyra standalone game brought down the slate tick from ~750µs to ~390µs.

Reducing the per frame calls is essentially the classic optimization tip of not using tick events. But more importantly its reducing the amount of calls that are made every frame. Such as not using/limiting Attribute Bindings, Timers and Animations.

- Louis

[Attachment Removed]

Hi there,

I see that Louis has followed up here with some very good resources that should help you make some actionable and tangible optimisations.

I will go ahead and close this case now, but please feel free to get in touch here again if you have any follow up questions.

Thanks,

Hayden

[Attachment Removed]