Performance: Configuration namespaces
MEDIUM IMPACT
This affects the startup time and memory usage of the application by organizing configuration loading and reducing unnecessary config parsing.
ConfigModule.forRoot({ isGlobal: true, load: [() => ({ namespaceA: configA(), namespaceB: configB() })] })
// Then inject only needed namespaces in modulesConfigModule.forRoot({ isGlobal: true })| Pattern | Config Loading | Memory Usage | Startup Time | Verdict |
|---|---|---|---|---|
| Global eager config loading | Loads all config at once | High memory usage | Longer startup | [X] Bad |
| Scoped config namespaces | Loads config per namespace | Lower memory usage | Faster startup | [OK] Good |