In my game I have created popup text for gained points when enemies are killed. it pops up wherever the enemy was and will say something like "+32" float up a bit and fade away at the same time. This transition lasts for a few seconds if that. and hundreds could appear at a time when AoE attacks destroy a lot of enemies.
That's all well and good. and it works! but I fear that this could become quite slow on mobile devices. So I did what any good game dev does. I pooled it!
Then it occurred to me. I'll still be changing the display value of the text elements dynamically and libraries like TextMeshPro already, in surely an optimized way, instantiate actual meshes to render text. So is pooling these text elements really a big optimization?
so here goes my question for experienced and knowledgeable devs. Is it more efficient to pool each character I need and assemble my short strings dynamically as sets of pooled gameobjects for these popups of just a few characters or should I simply pool text elements that will change their text just before appearing? Assume the memory usage difference is minimal. only worried about speed.
This is on top of the game having possibly thousands of projectiles moving at any given time, so I believe it is a valid optimization question, but I ask this more for curiosity than practicality. For now, I already have a working solution. but I believe such an issue could arise in the future. and want to satisfy my curiosity now.