Performance: Application lifecycle
MEDIUM IMPACT
This affects the startup time and responsiveness of a NestJS application by controlling how and when components initialize and clean up.
async onModuleInit() { await Promise.all([ this.heavySetup(), this.anotherHeavyTask() ]); }
async onModuleInit() { await this.heavySetup(); await this.anotherHeavyTask(); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Sequential async initialization | N/A | N/A | Blocks main thread delaying LCP | [X] Bad |
| Parallel async initialization | N/A | N/A | Reduces blocking, improves LCP | [OK] Good |