Parsing, Rendering, and Streaming Large JSON
Parsing is often not the bottleneck; rendering and copying are. Optimize along the four layers "parse → traverse → render → transport" so your effort is not wasted.
A JSON file of tens of megabytes can freeze the main thread, and carefully crafted JSON can punch through a service; this category covers both throughput and defenses.
6 articlesParsing is often not the bottleneck; rendering and copying are. Optimize along the four layers "parse → traverse → render → transport" so your effort is not wasted.
JSON.parse itself is safe; the danger is what happens after it: deep merging, assignment by path, inlining into HTML, unlimited depth and size.
Minifying cuts 30-50% off raw JSON, but gzip erases most of that gain. Measured numbers across real shapes, plus the four cases where minifying makes things worse.
A 10MB JSON file can become 30-50MB in the V8 heap. Learn what strings, objects and numbers really cost, how to baseline with process.memoryUsage, and when streaming helps.
Stutter starts when DOM nodes are created, not when you scroll. Covers collapse-first rendering, virtual lists, search highlighting and Worker boundaries, with metrics.
A multi-megabyte JSON export often freezes text editors and online viewers, yet parsing it takes only a few hundred milliseconds. We benchmarked a 45 MB, 500,000-record sample to measure time and memory at each stage, show why line count and node count are the real cost, and provide a size-based tool decision table covering online viewing, command-line extraction, streaming, and desktop apps.