HomeAlgorithms & AIPiece Table: The Text Editor's Secret Edit Buffer

📝 Piece Table: The Text Editor's Secret Edit Buffer

Type and delete text in a simulated editor and watch its piece table track original and add buffers with a linked list of piece descriptors, instead of copying the whole document on every keystroke.

Algorithms & AI3DModerate60 FPS
piece-table-editor-lab ↗ Open standalone

The simulation shows a live piece table backing a small text editor, visualizing the original buffer, the growing add buffer, and the linked list of piece descriptors updating as you type and delete characters.

🔬 What It Demonstrates

The simulation shows a live piece table backing a small text editor, visualizing the original buffer, the growing add buffer, and the linked list of piece descriptors updating as you type and delete characters.

🎮 How to Use

Type or delete text in the editor pane and watch the buffers and piece list panels update step by step, or use the playback controls to replay a sequence of edits and see exactly which pieces split or spliced at each step.

💡 Did You Know?

Because piece tables never overwrite existing buffer content, deleted text technically still sits untouched in memory even after it disappears from the document, simply no longer referenced by any active piece descriptor.

⚙ Under the hood

Type and delete text in a simulated editor and watch its piece table track original and add buffers with a linked list of piece descriptors, instead of copying the whole document on every keystroke.

piece tabletext editorsdata structureslinked listundo redotext bufferseditor internalsalgorithms

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)