(5.2) Performance Issues

I’ve noticed some perf issues with 5.2.0/5.2.0p1 in comparison with v5.1.3p3 (and previous versions) plus, during project upgrading, all UI elements where marked as RaycastTarget by default and some animators enabled “Apply Root Motion” where it was disabled.

I’m attaching three screenshots of a menu scene with may shed some light on possible causes out of my control. This happens when I press a button which moves menu panels:

  1. Gfx.WaitForPresent: on many frames it goes from 65 to 90% with ms ranging between 7 to 70.

  2. Font_InvokeTextureRebuilt_Internal: 197MB of GC Alloc?!!! 378 ms?!!!

  3. Overhead: this wasn’t a problem in v5.1.3p3 on the same scene, so I don’t know what would make VSync cause such a spike.

Are you guys on the QA team aware of (some of) these issues with the latest public version?



1 Like

Hey, dont think they reply to you unless you submitted a bug report, they very strict with this…

Bug report with a repro project is the way to go.

About the issues with fonts: someone already reported it and the response given was that a fix was created but it would probably not make it for the last released patch. So we will have to wait until this week’s release.

Regarding 1 and 3, it’s like not all of the rendering code on 5.1 branch was included on 5.2, yet. So early v5 issues that were fixed aroung 5.1 are now appearing again on 5.2: like WaitForPresent and VSync issues.

I understand they are strict regarding replies, but I prefer them to be strict on QA before releasing a version/patch. One or two days behind schedule is not a problem if major bugs are fixed. Otherwise, if they know a huge bug will still be there upon release -like the memory spike when creating fonts- that should be mentioned on the “Known Issues” section.

We have the same issues on Win7 with DX9 mode. WaitForPresent even goes crazy with VSync disabled, and the project converter for some reason set all UI elements to “Raycast Target”.

I can confirm that it also happens on Windows.

Having installed v5.2.1, I can confirm that the above-mentioned problems persist.

Regarding the issues with Font, enabling “Best Fit” seems to be the cause of the spike in many cases. For my game, when disabled, the spike gets deeply reduced.

The strange thing is that this did not happen upto v5.1.3p3 (included).

Good find :), yeh because on release 5.2 broke lot of things and UI system backend was some what redesigned, UI section of forum swamped with bugs and issues

Thread related to this : [5.2] Terrible performance spike causing by Font cache - Unity Engine - Unity Discussions

I confirm that best fit is the issue :slight_smile:

1 Like

Good to know, can someone link that thread or issue tracker please?

Best Fit is turned off, but I still can see Font.FontCache takes huge ms in profiler and lags in game.

Yep it looks like its deeper than that. My thread is related to yours.

I had same problem with Font.InvoikeTextureRebuilt_internal()
Try to select your font file and set the Rendering Mode to OS Default it will solve the problem

1 Like

Nice finding, @VictorCashDaShi ! That fixed it for me. Thanks for sharing.