Performance Problem: Unaccounted time between: LateBehaviourUpdate and CanvasRenderer.SyncTransform
So our company mobile game project has hit a major performance issue. We are suffering performance waves after a specific scene transition. And this wave persists through the rest of the application life time.
I'll start with by breaking down our scene flow 1. Splash Login 2. Main Menu 3. Battle 4. Main Menu .. rinse and repeat.
Our performance for going to the MainMenu the first time is fine. Not great. But it's 55 fps+. Once we go into the Battle our performance drops a lot when larger parts of the UI are open. Once we go back to the MainMenu our FPS is 30fps. And when we back in the battle our performance gameplay is even worse. For the rest of the application's life time this performance drop remains.
This issue occurred last week, apx a week after we migrated from Unity 5.40f3 to 5.5. Our first builds after 5.5 were fine. No performance problems. We have no notable features added, just mostly cleaning. ANd with the few small new features that were added we disabled them.
So going into our profiler we found that our main menu was acceptable for now, but our main menu was horrifying after the battle.
Here is is a snap shots of our Main Menu running on a Nexus 4 Android Phone. As can been seen mostly in the 60fps.
However once the battle is over we show a small UI in the Battle that informs you your rewards. The performance lowers. But there is little UI in the battle scene so this is barely acceptable. But once going back to the MainMenu this is the new snap shop of the profiler. As one can see the performance is down to around 30, and performance hits are in these waves.
In DeepProfiling the biggest cause seems to be "Unaccounted time between: LateBehaviourUpdate and CanvasRenderer.SyncTransform". In the non deep profiling this called Canvas.SendWillRenderCanvases.
I should have added that we are on Unity 5.5.0f3 for these profiling.
Answer by Sparklapse · Jan 13, 2017 at 10:03 AM
Weird thing I found that worked was setting your layout back to default (button is in the top-right corner.) I found it went from 24fps to 80fps. This may just affect me but I reckon it's worth a shot. I'd recommend to save your current layout before if you want to keep it (just in case). Let me know how it goes!
Answer by JasonVSG · Jan 13, 2017 at 04:09 PM
@Sparklapse Thanks for offering the suggestion. Unfortunately this had no impact on the mobile device performance.
Unaccounted time between: LateBehaviourUpdate and CanvasRenderer.SyncTransform and Canvas.SendWillRenderCanvases
are still causing performance issues on mobile device.
The problem is resolved.
We hooked into the Unity Event system by way of a third party UI. We hooked in with an On Close event. However something strange was going on. When the object is destroyed our performance drops.
I think it might be from using uisystem.oncloseevent -= eventfoo;
once we did that our performance shot up a lot.
@JasonVSG I have a similar issue but can't really understand your solution. Could you please explain what your solution was. Thanks in advance!
can you explain what your a third part UI name,thanks
We were using DoozyUI.
DoozyUI UIElement has an OnCloseEvent. We added a delegate to the onclose event. However, do to the fact that the delegate wasn't removed on Destroy, something was causing a performance issue. Once we added the -= function our issue was solved.
Your answer
Follow this Question
Related Questions
Gfx.WaitForPresentOnGfxThread costing over 30ms at RANDOM 0 Answers
Scene Culling WaitForJobGroup Causing CPU Spikes in 2D project 0 Answers
AICharacterControl Spike in Profiler 0 Answers
Mobile Performance Issues 0 Answers
3D Optimization Problem 1 Answer