While profiling in instruments I couldn’t help but notice a lot of time going towards things that really don’t feel like they should be taking that much time.
My project has shadows totally disabled in every way - quality settings, mesh renderers, shaders, etc. but it’s still spending a non-trivial amount of time inside SetupShadowCullData - is there any way to turn that off? Even if it’s not processing any renderers it’s still paying the overhead of setting itself up.
Another thing is that there seems to be a measurable performance hit with anything that calls UnityDisplayManager_GetDisplayDeviceAt:
(note: the view was filtered here so the parent timing is all off. The unfiltered timing of PlayerRender() was about 400ms in that sample)
All it seems to be doing is enumerating [UIScreen screens] and making a bunch of allocations. I’m not doing anything funky with airplay or video out, so it seems strange to pay such a high overhead for nothing. I hoped I could work around it in DisplayManager.mm somehow, but it looks like the right functions aren’t exposed for me to tinker with. Any ideas on how to avoid it? My project is very CPU bound, so I need to scrape together as many free milliseconds as I can.
I got the same results on Unity 5.4 and 5.5, and tested with two devices running iOS 9.3.1 and 9.3.5.
