Profiling Flashcards

1
Q

Tools

A

For iOS
: Instruments and the XCode Frame Debugger

For Android: the Snapdragon Profiler

For platforms running Intel CPUs/GPUs: VTune and Intel GPA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Dissecting startup traces

A

UnityInitApplicationGraphics performs a lot of internal work, such as setting up the graphics device and initializing many of Unity’s internal systems. In addition, it initializes the Resources system. To do this, it must load an index of all of the files contained by the Resources system.

UnityLoadApplication contains methods that load and initialize the first Scene
in the project. This includes deserializing and instantiating all of the data necessary to display the first Scene, such as compiling Shaders
, uploading Textures and instantiating GameObjects
. Additionally, all MonoBehaviours in the first Scene have their Awake callbacks executed at this time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Dissecting run time traces

A

BaseBehaviourManager calls three templated versions of CommonUpdate. These invoke certain callbacks within MonoBehaviours attached to active GameObjects in the current Scene.

CommonUpdate calls Update callbacks
CommonUpdate calls LateUpdate callbacks
CommonUpdate calls FixedUpdate if the physics system has ticked

UI::CanvasManager invokes several different callbacks if a project uses Unity UI
.
DelayedCallManager::Update runs coroutines.
PhysicsManager::FixedUpdate runs the PhysX physics system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Dissecting a script method

A

When scripts

are invoked on platforms cross-compiled with IL2CPP, look for trace lines containing a ScriptingInvocation object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Asset loading

A

Asset loading can also be identified in CPU traces. The main method indicating an Asset load is SerializedFile::ReadObject. This method connects a binary data stream (from a file) to Unity’s serialization system, which operates via a method named Transfer. The Transfer method can be found on all Asset types, such as Textures, MonoBehaviours and Particle Systems
.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly