Outline.ModifyMesh() is allocating insane amounts of memory (325k GC Alloc) and taking a whopping 18ms , previously on exactly the same project it was taking practically no time at all and not allocating memory…
Graphic.UpdateMaterial() is now allocating memory…?
The new RectMask2D is great, but again, using it is causing massive garbage collection as ClippedRegistry.Cull is allocating memory every frame.
Looks like a switch back to 5.1 for us until these problems are fixed, which is a shame as I’ve just spent a couple of days refactoring tons of OnFillVBO() stuff to use OnPopulateMesh() - massive waste of time!!
Take a look at the profile of the same scene, at the same point… 5.1 vs 5.2
The obvious one to notice is the insane memory allocation for OutLine.ModifyMesh(), but also notice Graphic.UpdateMaterial() is now allocating memory which is horrible when you have a fluid UI with lots of stuff moving around and animated, I’m getting 60+ calls to UpdateMaterial a frame on some of the more complicated animated UI’s.
It’s almost as if you guys setup a worst case single scene with millions of textboxes + buttons, refactored the entire UI code to make that specific scene perform better and then just released the code! Oh, wait… ( Unity Blog )
Turns out using the inbuilt Outline / Shadow effects is not such a good idea when you have a triangle mesh with optimal verticies anyway, the first thing outline does is destroy your optimized verts…
I’ve added native support for outlines and shadows into our ui extensions and everything is working extra funky, extra quick, with half as many vertices as unity 5.1
I can’t test in 5.2.1p1 as they handily changed the API for OnPopulateMesh() to use that god awful vertex helper class instead of a standard Mesh - they haven’t supplied any documentation or updated the UI Bitbucket source code either.
Nice work. Good luck beta testing 5.2 on your own guys. I’m not going near 5.2 again until they quit messing us around.
Yep, the method Shadow.ApplyShadowZeroAlloc indeed doesn’t alloc any memory, but it takes a huge cpu overhead 8ms in an i7 for 20 texts with 6 short words each.