- Home /
MonoBehaviour Update() performance vs handling updates in a single UpdateManager script
Hi,
I recently found this really great article regarding Unitys performance when having many MonoBehaviours with Update() function in a scene vs. Handling the updates with a custom written Update manager:
https://blogs.unity3d.com/2015/12/23/1k-update-calls/
The conclusion of the article is, that when testing the game with 10000 MonoBehaviours with Update() functions implemented, the game could perform 4 to 11 times faster when the update functions are not handled by Unity, but instead with a custom Update Manager class. This was tested on an iPhone 6 and an iPhone 4s and the article also shows why there is a huge performance overhead when using the MonoBehaviour Update() function.
So my question: Is there always a noticeable performance advantage using a Custom update handler for scripts instead the Update() functions in MonoBehaviors and would it be worth rewriting game logic to avoid using the Update() functions of MonoBehaviours?
The example in the article is a bit extreme, because in a real game, there would hardly be 10000 active gameObjects with Update() functions in a scene, also the update functions would be much more complex (since in the article, there is only one line of code in every Update() function). I personally do not see any downside to handling the updates of objects yourself if you know your code. But nevertheless, I would be curious if it is worth it for a regular game performance wise?
Your answer
Follow this Question
Related Questions
What is better: Set a animator variable each frame or use a if to check if need? 2 Answers
Advice about overdraw 1 Answer
Best way to create/design modular Player 2 Answers
List Performance Question 2 Answers
Calling gameobject.transform vs. just calling transform directly - Performance negligible? 1 Answer