Performance: Awake vs Start execution order
MEDIUM IMPACT
This concept affects the initialization timing of game objects, impacting frame load time and responsiveness during scene startup.
void Awake() {
// Lightweight setup
InitializeBasicStuff();
}
void Start() {
// Setup that depends on other objects
InitializeHeavyStuff();
}void Start() {
// Heavy setup that depends on other objects
InitializeHeavyStuff();
}
void Awake() {
// Empty or minimal
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Heavy initialization in Start | N/A | Blocks main thread | Delays first frame paint | [X] Bad |
| Lightweight Awake + deferred Start | N/A | Minimal blocking | Smooth first frame paint | [OK] Good |