---
title: "How we made JSON.stringify more than twice as fast"
description: "V8 more than doubled JSON.stringify throughput on the JetStream2 json-stringify-inspector benchmark by adding an iterative, side-effect-free fast path that skips the general serializer's defensive checks."
url: "https://swe.quest/articles/how-we-made-json-stringify-more-than-twice-as-fast-a8feda7c2e371e2a"
canonical: "https://v8.dev/blog/json-stringify"
source: "V8"
published: "2025-08-04"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 7
tags: ["runtimes","javascript","performance","browsers"]
---

# How we made JSON.stringify more than twice as fast

A post on [V8](https://swe.quest/sources/v8.md), published 2025-08-04, 7 min read, Deep dive. Original: [https://v8.dev/blog/json-stringify](https://v8.dev/blog/json-stringify)

## Summary

V8 more than doubled JSON.stringify throughput on the JetStream2 json-stringify-inspector benchmark by adding an iterative, side-effect-free fast path that skips the general serializer's defensive checks. Supporting changes include templatizing the stringifier on one-byte vs two-byte strings, SIMD and SWAR scanning for escapable characters, and a fast-json-iterable flag on hidden classes that lets keys be copied without checks. Numbers are now converted with Dragonbox instead of Grisu3, and output goes to a segmented Zone-allocated buffer to avoid realloc-and-copy. The fast path ships in V8 13.8 (Chrome 138) and applies only without replacer/space arguments, custom toJSON, indexed properties or ConsString-like strings.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)

## Prerequisites

- JavaScript engine internals ([easy posts on Runtimes & VMs](https://swe.quest/tags/runtimes.md?difficulty=easy))
- hidden classes
- SIMD basics
- string encodings

## Keywords

V8, JSON.stringify, Dragonbox, Grisu3, SWAR, SIMD, JetStream2, Chrome 138

## Related posts

- [Celebrating 10 years of V8 · V8](https://swe.quest/articles/celebrating-10-years-of-v8-v8-26690aa14d628d44.md): V8 · 2018-09-11 · Easy · 9 min read · Runtimes & VMs, JavaScript, Compilers, Memory management, Performance engineering
  V8 grew over ten years from a secret project started in 2006 on a Danish farm into a JavaScript and WebAssembly engine supporting eight instruction sets, embedded by both Chrome and Node.js.
- [V8 release v6.9 · V8](https://swe.quest/articles/v8-release-v6-9-v8-d0efd26e2594b2df.md): V8 · 2018-08-07 · Easy · 4 min read · Runtimes & VMs, JavaScript, Memory management, WebAssembly, Compilers
  V8 v6.9 embeds built-in functions directly into the binary on x64, so all Isolates share one copy instead of each holding up to 700 KB on its own heap.
- [500x faster postMessage(string)](https://swe.quest/articles/500x-faster-postmessage-string-575e19a5ee69829f.md): Bun · 2025-08-20 · Medium · 3 min read · Runtimes & VMs, JavaScript, Performance engineering, Concurrency
  Bun v1.2.21 makes postMessage(string) between workers nearly independent of string size, up to 500x faster with ~22x less peak memory on 3 MB strings (593 ns vs 326,290 ns in 1.2.20).
- [Land ahoy: leaving the Sea of Nodes](https://swe.quest/articles/land-ahoy-leaving-the-sea-of-nodes-b461320cb50dc764.md): V8 · 2025-03-25 · Hard · 25 min read · Compilers, Runtimes & VMs, JavaScript, WebAssembly
  V8 is replacing Sea of Nodes in its Turbofan optimizing compiler with Turboshaft, a traditional control-flow-graph IR.
- [Speculative Optimizations for WebAssembly using Deopts and Inlining](https://swe.quest/articles/speculative-optimizations-for-webassembly-using-deopts-and-inlining-bb89e7c53ac7945f.md): V8 · 2025-06-24 · Hard · 17 min read · WebAssembly, Compilers, Runtimes & VMs, Performance engineering
  V8 in Chrome M137 adds speculative call\_indirect inlining and deoptimization support for WebAssembly, using runtime call-target feedback gathered by the Liftoff baseline compiler so TurboFan can inline up to four likely callees behind cheap instance and target checks.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
