-
Notifications
You must be signed in to change notification settings - Fork 134
Performance critical context and costly methods
Vladimir edited this page Dec 7, 2018
·
11 revisions
Unity methods like Update
, LaterUpdate
, FixedUpdate
, etc are called each frame, so these methods can affect performance of your game.
Rider will highlight these methods and each method which is reachable from them via line markers on gutter (you can disable it in Unity plugin settings, also you can change color for highlighting in our common settings). Together these methods make up the performance critical context
. Highlightings will help you to understand that you should be careful when writing code and try not to invoke costly methods inside performance critical context
.
Rider will highlight well-known costly methods in performance critical context:
-
AddComponent<MonoBehaviour>
invocation -
Invocation of
Find
methods -
Invocation of
GetComponent
methods - String based method invocation
-
Camera.Main
usage -
Null comparisons against
UnityEngine.Object
subclasses