Menu

Deduplicating execution traces in TypeScript: 6.7 MB down to 0.4 MB
📰

Deduplicating execution traces in TypeScript: 6.7 MB down to 0.4 MB

DEV Community: javascript·Abdelrahman Ahmed Abdelazeez·7 days ago
#QpxvKf4C
#devtojavascript#devto#dev#file#object
Long article (1255 words) — no AI summary yet.
Reading 0:00
15s threshold

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 easy to write and it explodes: a linked list of 300 nodes recorded over 2,000 steps was 4.8 MB of JSON, and a 367-step run over forty small dictionaries was 6.7 MB.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.