惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
C
Check Point Blog
月光博客
月光博客
Y
Y Combinator Blog
I
InfoQ
B
Blog RSS Feed
P
Proofpoint News Feed
腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
罗磊的独立博客
B
Blog
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
Recent Announcements
Recent Announcements
美团技术团队
大猫的无限游戏
大猫的无限游戏

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I Built a React JSON Tool That Handles 150k+ Lines Wi...
Divyanshu De · 2026-04-24 · via DEV Community

Most JSON tools work fine… until they meet real-world production data.

We’ve all been there: You paste a massive payload into a web-based formatter, and suddenly:

The page stops responding.
Scrolling becomes a stuttering mess.
The "Page Unresponsive" popup appears.
I encountered this while debugging complex automation flows and deeply nested configurations. I needed a tool that could handle 150k+ lines of JSON without falling apart, but I didn't want to compromise on privacy by sending that data to a backend.

So I built Dev Suite - a client-side toolkit designed for performance-first JSON manipulation.

Why Large JSON is a "Systems Engineering" Challenge

Performance in the browser isn't just about a fast for loop. It’s a multi-layered bottleneck involving:

  1. Parsing Cost: Converting a 10MB+ string into a JavaScript object.
  2. Memory Pressure: Storing that object and its associated metadata.
  3. DOM Complexity: The browser struggling to calculate layout for 5,000+ nodes.
  4. React Overhead: Re-renders triggered by state changes during heavy interactions. Here is how I tackled the specific challenges of scaling the tool from 50k to 150k+ lines.

1. JSON Path Finder: Reducing the Noise

The Path Finder returns dot-notation paths (e.g., payment.gateway.retry.maxAttempts). While the logic seems simple, iterating through a massive tree structure can generate significant "noise."

The Challenge: Array Explosion
If you search for a key like feeTypesand it’s an array of 1,000 objects, a naive search might return: feeTypes[0], feeTypes[1], feeTypes[2]...

The Fix: AST-Based Traversing
I implemented a search algorithm that walks the Abstract Syntax Tree (AST) of the JSON. Instead of a flat search, I added conditional result filtering. This ensures users see the meaningful parent matches first. By intelligently pruning the traversal, we keep the UI clean and the search execution time sub-millisecond.

2. Solving the "5,000 Element" Freeze

If a search returns 5,000 matches, and React tries to render 5,000 buttons (each with icons, hover states, and tooltips), the main thread will lock up for several seconds while the browser paints.

The Solution: Virtualization
I implemented DOM Virtualization. Instead of rendering all 5,000 results, the tool only renders the ~20 items currently in the user's viewport. As the user scrolls, DOM nodes are recycled and updated with new data.

3. Bypassing the React Render Cycle

React is amazing for state management, but it can be a bottleneck for text editors. If every keystroke in a 100k-line file triggers a React state update and a virtual DOM diff, the latency (typing lag) becomes unbearable.

The Fix: Decoupling the Editor Engine
I moved the "hot path" away from React's state. By using an uncontrolled component approach with the underlying editor engine (CodeMirror/Monaco), I severed the connection between the typing engine and React’s render cycle.

4. JSON Diffing

A standard text diff is useless for JSON because key order often doesn't matter. JSON Diff Checker helps to check differences between two JSONs semantically.

The Solution: Order-Invariant Comparison
I built a recursive diffing algorithm using Map and Set data structures.

  • It identifies Added, Removed, keys with modified value and keys with value type changed.
  • It ignores object key order (semantic equality).
  • It handles nested structures recursively.

Navigating the Diffs
In a 150k line file, you can't just "jump" the user around. I implemented Binary Search over the sorted array of diff locations. This allows the "Next" and "Previous" buttons to find the closest difference relative to the user's current scroll position instantly.

The Result

Dev Suite now handles 150k+ lines of JSON with ease. It’s been an insightful journey into the limits of browser performance and the importance of choosing the right tool for the right job (even if that tool is "Not React" for certain specific tasks).

There are more tools at Dev Suite , you can explore
👉 https://devsuite.tools/mermaid-class-diagram-to-java
👉 https://devsuite.tools/mermaid-class-diagram-to-cpp
👉 https://devsuite.tools/yaml-diff
👉 https://devsuite.tools/yaml-pathfinder

I'd love to hear from you:
What’s the largest JSON payload you’ve had to debug in a browser? Did your existing tools survive, or did you have to reach for the terminal?

Let's discuss in the comments!