Performance: Module decorator and metadata
MEDIUM IMPACT
This affects the initial application startup time and memory usage by controlling how modules and their metadata are loaded and instantiated.
@Module({ imports: [HeavyModule], controllers: [], providers: [] })
export class AppModule {}@Module({ imports: [HeavyModule, UnusedModule], controllers: [], providers: [] })
export class AppModule {}| Pattern | Module Imports | Startup Delay | Memory Usage | Verdict |
|---|---|---|---|---|
| Import all modules eagerly | Many heavy modules | High (100-200ms+) | High | [X] Bad |
| Import only needed modules | Minimal required modules | Low (50ms or less) | Low | [OK] Good |