Unity 5.1 vs. 5.3 UI Performance

So, I’ve spent some time today to get my project ready for Unity 5.3, and after finally adjusting everything, updating the appropriate plugins etc. I found out that performance is reduced to about 60% in my UI heavy scenes. Where running the scene in the editor had me at about 700-1000 fps earlier on my machine, using 5.3 I’m down to 400-600 fps.

Is there anything on that? Ways to mitigate it? Do the Unity guys have this problem in their sights so we can expect this to improve with patches?

I’m going to go with a big nope on that one (the whole fact we dont have the problem in our sights as we havn’t heard this before). The typical response of “Can you send us a repo project to test against?” i think is in order :slight_smile:

Well, the project is pretty big… I can see if I can build a smaller repro project

Option 2 would be to give me repo access or something (temporary and read only of course) and i can pull it instead of you needed to upload a large project.

Here’s some screens of the same view in the editor. with 1200 vs 460 fps


Any chance you can run the profiler @Democide to see where the hold up is coming from, just in case one of the scripts is using redundant 5.2 functionality. There was a fair amount of change from the 5.2 base build to 5.3

Sure. If you can tell me what specifically to do or to look for.

Something taking a long time :stuck_out_tongue: possibly @phil-Unity , if you have any suggestions what it could be?

Hm. Well there are massive PhysX spikes every once in a while (even though I have no physics at all in the scene), the rest of the time it’s EventSystem.Update();

With Deep Profile eneabled it looks to be the StandAloneInput:

For some weird reason, there’s also a bunch more draw calls… Could be TextMeshPro?

really?

That does seem a huge spike in the GraphicsRaycaster, over 707 calls for testing depth.
Are only the items that the user clicks on marked as “Interactable”?

As for TextMeshPro, @Stephan-B would be able to comment, but it should save you overall with draw calls, not increase them. The increase could be due to the change in the new Mesh Based UI rendering introduced in 5.2.2.

@SimonDarksideJ good point with the “Interactable”. I remember seeing that in 5.3 a flag was added to graphics whether they are interactable or not. I hadn’t touched that for my changes, just looked at getting all the scripts back in working order. I’ll see if that changes anything…

As Simon said Could be TextMesh but could also be the new batching system that was introduced in 5.2. Its possible its not finding the same overlap possibilities and such needs more batches to draw everything.

As for the spike it seems weird as i know the EventSystem hasn’t had any majour changes as of yet so there should be no additional spike caused by it. I’d be curious to see if 5.1 has the same spikes as it might lead us to something else.

Yea we havn’t heard of massive performance drops caused by 5.3. Like we know of some that were in 5.2 but they should have been resolved.

Well, in 5.3 the spikes I saw were the PhysX system, which is weird. There are some spikes (2-3 / second) in both versions, though they seem to be more pronounced in 5.1, which are linked to gfx.WaitForPresent and/or canvas.RenderOverlays - WaitingForJob, I think. The WaitingForJob seems to be linked to action within the UI - maybe the CrossFadeColor / CrossFadeAlpha I use a bunch of times?

Set everything that didn’t need raycasting to “Raycast Target” false, but that doesn’t seem to change anything.

5.1 has the “canvas.RenderOverlays - WaitingForJob”? or 5.3 i dont think 5.1 has the threaded renderer so should never be waiting…

It’s only GFX.WaitForPresent in 5.1.

Yea thats ok as i think thats the vsync kicking in.

As for the WaitingForJob do you have the multithreaded rendering turned on for the platform you are targeting?

Haven’t changed anything in any settings, so it should be the default…