Hi - I have been trying to dig into why the outline generation on text is so slow but in the process i think i have found a bug where it reserves much more space for the vertices than is necesary:
protected void ApplyShadowZeroAlloc(List<UIVertex> verts, Color32 color, int start, int end, float x, float y)
{
UIVertex vt;
var neededCpacity = verts.Count * 2;
if (verts.Capacity < neededCpacity)
verts.Capacity = neededCpacity;
The problem is that verts.Count is increasing with each shadow drawn - I beleive the correct thing to do is add (end - start) rather than multiply by 2 (but could be wrong on that).
As far as I can tell this memory will be free’d up again once the verts have been added to the mesh so this problem only results in a spike in memory use but it would still be cool to get a fix as for a paragraph of outlined text the allocation can be quite large