“If we can guarantee that serializing an object will not trigger any side effects, we can use a much faster, specialized implementation.”
V8 team doubled JSON.stringify performance through classic optimization work. SIMD for string scanning. Better buffer management. Dragonbox for number conversion. Hidden class tracking to skip repeated checks. The key insight: most serialization has no side effects, so skip the safety checks when you can prove it. Available in Chrome 138. This is what browser engine work should look like.