{
  "id": 22688403,
  "title": "Deduplicating execution traces in TypeScript: 6.7 MB down to 0.4 MB",
  "url": "https://urgent.news/2026/11/30/deduplicating-execution-traces-in-typescript-6-7-mb-down-to-0-4-mb",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-30T00:00:35.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/abdelrahman_ah1/deduplicating-execution-traces-in-typescript-67-mb-down-to-04-mb-4hca"
  },
  "original_language": null,
  "account": "A code visualizer allows users to view and step through Python or C++ programs in a browser. The visualizer records each execution step, resulting in large JSON files. To reduce file sizes, a system was created to store unique objects once and reference them later. This is done by creating a pool of distinct heap objects and mapping object IDs to pool indices. Objects are considered identical when their canonical text, obtained by sorting keys recursively, matches.\n\nThis optimization reduced a 6.7 MB file to 0.4 MB for a 367-step recording and a 4.8 MB file to 1.2 MB for a 2,000-step list. For changing objects, a delta can be stored to represent changes from an earlier entry. To ensure the compressed file remains accurate, the encoded data is decoded and compared to the original using the canonical text representation. If the comparison fails, the reformatted format is not used.",
  "summary": "I am building a code visualizer: you paste a Python or C++ program, it runs it, and you step through the execution with boxes, arrows and a variables panel. Replay happens entirely in the browser from a saved recording, so stepping back never re-runs your program. The recording is the interesting part. A tracer takes a snapshot at every step, and each snapshot contains every live object. That is…",
  "summary_source": "publisher",
  "key_points": [
    "Deduplication reduces 6.7 MB TypeScript trace to 0.4 MB",
    "Unique objects stored once, referenced later via IDs",
    "Delta encoding represents changes between object versions"
  ],
  "editors_take": "By storing unique objects only once, this new system allows users to view large program execution traces in a browser without the burden of massive files.",
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}