Performance considerations

Hey,

I’m working with the hololens and it is very sensitive to performance.

Is there anywhere I can read on best practices with TMP in regards to performance?

Anything I definitely shouldn’t do? like with ugui best fit option

My first toe dip into performance has shown there are different prices for TextAlignmentOptions.
A test of 1024 texts with random text. the first chunk is rendered Midline and the chunk in the end is Capline

Surprisingly in LateBehaviourUpdate where tmp text uses time it’s the same for both.

I’ll continue to explore

Exploring all the different alignment options a bit more systematically.
The bulk of difference is in PlayerSendFrameStarted…
Sadly the profiler data is a bit to large to upload

autoSizeTextContainer&enableKerning didn’t have any effect on vanilla drawing.

enableWordWrapping cost more as you can see on the right.

For drawing, the size (on screen), number of text objects and shader selection and what features are enabled on the shaders will have an impact on performance.

Text auto-sizing which is very expensive will have an impact on the cpu when the text is being regenerated.

but given the same amount of texts on the screen which features will cost more or less than others.

TextureMappingOptions didn’t seem to affect drawing performance much.

See the following link from the TextMesh Pro user forum about the shaders.

Ah thanks! That makes a lot of sense, I’m already at the unlit mobile text :slight_smile:

Deep Profile and profiling in the Editor isn’t very representative of how a particular piece of code performs.

Deep Profile in particular often leads to wrong performance conclusions, because the overhead of method instrumentation itself gets expensive really fast and falsifies the results. Deep Profile often causes code, which actually performs fast, to appear as utterly slow.

In my experience, Deep Profile is useful to find where GC Alloc’s are made, or to get an idea what a particular method is actually doing, but I don’t use it to judge whether a function needs to be optimized.

Ah yeah the images might be a little misleading, all the test are running on a Microsoft Hololens and not in the editor.
With remote profiling the deep flag doesn’t have much effect to my knowledge and the fps with/without attach profiler is minimal I think.