I’m seeing a vast amount of time disappearing in the function “Destroy” when profiling my game on an iPad1 (it’s also a factor on an iPad2 grab but orders of magnitude less painful). At the point I was recording I was doing a lot of procedural mesh creation and so destroying last frame’s mesh each update. Most likely it’s related to that?
Just wondering if anyone can shed any light on what exactly could be going on, i.e what could be being destroyed that would take so long (and why)? Most importantly is there anything I can do to eliminate or lessen the expense?
Hopefully you can see a screen-grab from the profiler below:

Thanks!
Certainly it would be unusual in any game to be creating or
– WazDestroying a GameObject or a Component every frame.Be sure to watch this video: http://www.youtube.com/watch?v=IX041ZvgQKE even if you don't use C# you can use the object pooling script he writes, which is pretty awesome.
– anon73820239There isn't a lot you can do about arrays - Unity copies them every time they pass into or out of a setter/getter in the Unity API. Best you can do is minimise other copies. Maybe using arrays of same size will trigger optimisations inside Unity.
– Waz