Express

Inconsistent object shapes prevent V8 optimization

warning
performanceUpdated Feb 8, 2026(via Exa)
Technologies:
How to detect:

Creating objects with different property sets based on conditional logic creates multiple hidden classes in V8, preventing optimization of property access.

Recommended action:

Always create objects with the same property set. Use default values (empty string, 0, null) instead of conditionally adding properties. Verify optimization with --trace-opt flag.