mojira.dev
MC-249635

Text rendering has a considerable impact on performance

For some reason text rendering seems to consume a lot of resources, such that a large amount of text on the screen tends to drastically drop frame rate in some scenarios.
Nameplates are an example of this when enough of them are shown, notably when a large amount of players get rendered on the screen or in servers that make use of armor stands as "holograms" to make floating text.

[media]

[media]

There are other cases where this issue is present as well, however as they're a lot i only listed the most notable ones:

  • Entity nameplates / text_display entities (the most prevalent).

  • HUD text (chat, tab list, sidebar, etc).

  • GUI text (menus, item tooltips, etc).

  • Glow signs (text rendered 9 times, see MC-226966).

  • Obfuscated text ("scrambled" text effect, see MC-253502).

  • Debug menu (F3).

  • etc...

How to reproduce

  1. Summon a few text display entities with the following command:

    /summon minecraft:text_display ~ ~ ~ {text:'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}
  2. Notice the frame rate, with enough nameplates you might notice the fps drop.

Linked issues

Attachments

Comments 8

I have also noticed these severe performance drops with text rendering. Id suggest using an external frame counter since the f3 menu is a wall of text itself and the fps counter within it will not reflect your actual fps when the menu isn't active.

The graphs shown in the screenshots were taken while F1 was enabled, so only the last frame was actually with F3 (you can also notice it in the graph). Otherwise yes, the frame rate could have been worse.

But yeah, an external fps counter might be an option too.

I used a small mod to draw the fps on screen without f3 and noted that with no text on screen (besides the text I added) I got over 1000fps but when even 1 line of chat being rendered, it dropped significantly. And this is even when using performance improvement mods.

When joining a multiplayer server that has lots of players, signs, holograms and a full tab list, I can expect < 30 fps on versions 1.17 and above. Its pretty rough.

Perhaps this issue could be renamed to cover the broader issue of text rendering performance issues.

After some time of thinking i've edited the report to cover the overall issue of text rendering being slow, as all the listed cases are caused by this. However i still considered the main focus of this issue to be the performance hit with rendered nameplates, just so this doesn't get too broad about text performance.

Can confirm in 1.19.1.

Also worthy of note: If you have a resource pack that increases the resolution of fonts it will significantly reduce performance as well. If you are having performance issues with text and have a high res font, consider lowering the resolution or using vanilla font. Even with that said, text rendering is still significantly slower than it was prior to 1.17

partial solution use:

-DspriteAtlasTextures:false

 

Performance seems to have worsened as of 25w16a, when rendering entity nameplates.

[media]

syarumi

(Unassigned)

Confirmed

Platform

Important

Performance, Rendering

1.17.1, 1.18.2, 22w12a, 22w15a, 22w16b, ..., 24w33a, 1.21.2 Pre-Release 1, 1.21.4, 1.21.5, 25w16a

Retrieved