Performance: Whitelist and transform options
MEDIUM IMPACT
This affects the request processing speed and memory usage by controlling which properties are accepted and how input data is transformed before reaching business logic.
app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));app.useGlobalPipes(new ValidationPipe({ whitelist: false, transform: false }));| Pattern | CPU Usage | Memory Usage | Validation Speed | Verdict |
|---|---|---|---|---|
| Whitelist: false, Transform: false | High (manual checks) | Higher (extra data kept) | Slower (manual parsing) | [X] Bad |
| Whitelist: true, Transform: true | Lower (automatic filtering) | Lower (only needed data) | Faster (auto conversion) | [OK] Good |