Optimize GC in Unity5.4.4
DavidSheh opened this issue · comments
Sheh伟伟 commented
I found 40B GC in UpdateAllTimers() function of TimerManager class that was caused by foreach and my unity version is 5.4.4. However, all the lower versions have this issue as to my knowlege.
Before optimize:
foreach (Timer timer in this._timers)
{
timer.Update();
}
After optimize
for (int i = 0; i < this._timers.Count; i++)
{
this._timers[i].Update();
}
Alexander Biggs commented
Sorry for the incredibly, incredibly slow response. According to https://jacksondunstan.com/articles/3805 this should no longer be an issue after Unity 5.6.