I'm getting very poor performance out of the TextPrinter for text that is dynamically changing. For example: displaying a number that may change every frame.
Is there anything I can do to get around this?
I've just looked at the code for the TextPrinter, and it appears to cache at two levels:
1) At the glyph level (what I would expect)
2) At the text block level (this seems very odd to me!)
Clearly my text blocks are changing very rapidly, and so caching at this level does not make sense. Presumably there is some overhead to building a display list, so could this be what is causing the performance issue I'm seeing?
I've only glanced at the code, so I can't say I have much understanding of it, but if I were to fiddle with the rendering code so that it does not build a display list to be cached when rendering a block, do you think I might be able to improve the performance?
There is something that looks very suspicious to me: the delay I'm getting when new text blocks are added appears to always be the same, no matter how many new unique text blocks are added that frame. Also, it appears to always be ~16ms , which leads me to believe that something in the TextPrinter is causing a wait for the next Vsync. Is this possible?