next.js
aa13f252 - Keep VaryPath monomorphic by making isRootParam required (#96122)

Commit
30 days ago
Keep VaryPath monomorphic by making isRootParam required (#96122) `VaryPath` nodes are created and traversed on a very hot path in the segment cache, so their object shape matters for performance. `isRootParam` was optional: most nodes left it undefined while a few set it, so nodes had inconsistent shapes. That prevents V8 from sharing a single hidden class across them and deopts the cache hot paths. This makes `isRootParam` a required boolean, always set (`false` for structural and search param nodes), so every `VaryPath` node has the same shape and these paths stay monomorphic.
Author
Parents
Loading