TextMeshProUGUI.Rebuild Mobile Performance 7000ms to Render

Hi,

I was having issues when loading a game to an android (Samsung S8). I saw an insane 7000ms delay when changing from one scene to other.

So, I began profiling to see what happens and I attach what I’ve seen.

This image shows what happens when changing from a canvas UI scene with a video player (playing a video) to other canvas UI scene having 5 TextMeshProUGUI (one of those have Localization String Event script for translate).

How can I solve that?

If I use normal Text component it delays 300ms just because Localization String Event script for translate.

Should I use normal Text component instead?

Many Thanks!

Try disabling WaitForCompletion on the localized string. This should let it load asynchronously and not block the thread.

Hi, karl!

It is disabled. The problem happens when changing between a scene with a video player playing video and other scene with a TMP that has to be rendered (and also localized). After a scene with TMP is loaded there is not other lag loading other scenes with TMP, it is just the first scene load after a scene with video player.

Can I free the memory used by video to render faster TMP?

Thanks!

In the profiler I can see that WaitForCompletion is being called so it looks like it’s enabled somewhere on one of your localize string scripts.
Freeing memory won’t make tmp faster.

Hi karl!

You were right! After disabling WaitForCompletion this is what I see.

Thanks!

8156042--1059893--Captura de Pantalla 2022-05-25 a las 10.14.56.png

1 Like

Hi Karl,

How can I have a better performance on the last image of the profiler?

Is taking more than 2500ms to render TMP.

Thanks!

8156042--1059893--Captura de Pantalla 2022-05-25 a las 10.14.56.png

Its loading the TMP_Settings asset. You could try loading it at another time by calling Resources.Load<TMP_Settings>("TMP Settings"); yourself.
Maybe try using Resources.LoadAsync

Before your answer I tried to add a hidden TMP on my first scene, and after the load of the first scene all the app runs faster loading scenes. Is kind a workaround.

Thanks!

Yeah that’s basically doing the same thing :wink:

Could you please post an inspector image of your TMP Settings?

i would like to know what other assets are referenced in it.

1 Like