Pick Heddle
For versions a person steps through: undo that survives a reload, branches, restoring one part of an old version, a history panel, a format you can read. One commit per decision.
Comparison · version 0.8.0
What else does this job, what each is best at, and one workload measured on all of them.
Heddle is a new library and this page is still being written. The feature notes were read from each project's documentation in November 2026 and may be out of date or unfair to a project we know less well. The numbers are one small workload on one machine. Where Heddle loses, this page says so, and it loses on speed and on size.
For versions a person steps through: undo that survives a reload, branches, restoring one part of an old version, a history panel, a format you can read. One commit per decision.
For several people typing into the same thing at once. Yjs for live text and speed. Automerge when the full history of a shared document matters too.
For undo within one session, an undo stack or Immer's patches are smaller and faster than any of these.
A CRDT document with its whole change history, in a compact binary format, with a Rust core compiled to WebAssembly.
Best when: Several people edit the same document at once, offline included, and merges must happen by themselves.
Against Heddle: Automerge merges concurrent edits itself and stores history far more compactly. Heddle reports a conflict and lets the app choose, keeps plain JSON anyone can read, and adds undo, a scrubber and partial restore. Heddle ships about a hundredth of the code.
A CRDT of shared types (maps, arrays, text) built for live co-editing, with editor bindings, network providers and an awareness protocol for presence.
Best when: Live co-editing, text above all: it is the fastest and best connected option for that.
Against Heddle: Yjs is hundreds of times faster per edit and syncs in tiny updates. By default it does not keep old versions, and its undo is a session stack. Heddle keeps every version, on disk, with ids, branches and a way to check them.
Immutable updates written as mutations, which can emit a patch and an inverse patch per change.
Best when: You want undo and redo in one session and are happy to keep the patch log yourself.
Against Heddle: Immer is smaller and much faster, and it is not a history: no ids, no file format, no branches, no merge. Heddle is what you would otherwise build on top of the patches.
Past, present and future kept as snapshots or commands in memory: redux-undo, zundo, or a few lines of your own.
Best when: Undo and redo that end with the session are all you need.
Against Heddle: Nothing is simpler. Heddle's linear model has the same shape for the user, and adds saving with the undo position, shared storage of unchanged parts, and an upgrade to branches without a migration.
A real repository beside the app, through the git binary or isomorphic-git, with the document as files.
Best when: The document already is files, and people want to use git tools on it.
Against Heddle: Git has every history feature and a vast toolchain. It versions bytes in files: a merge is line-based, and the app must map its state to a tree. Heddle versions the JSON state directly, merges by key, and runs in a page with no file system.
A database made for samples by time, on a server or embedded.
Best when: Ticks have to be kept for good, queried across devices, or number in the millions.
Against Heddle: Heddle's stream is a capped buffer in memory with time lookups, candles and chunks. It is for the ticks an app needs while it runs, such as cursors and a chart's recent window, and it is not a database.
| Heddle | Automerge | Yjs | Immer with patches | An undo stack | |
|---|---|---|---|---|---|
| You hand it | The whole state, as JSON | Changes to a document | Changes to shared types | A function that mutates a draft | A state or a command |
| Old versions kept | Every commit | Every change | Not by default | If you keep the patches | In memory, often capped |
| Undo and redo | Built in, saved with the document | You build it | UndoManager, for the session | You apply inverse patches | Yes, that is all it does |
| Branches | Graph model | Fork and merge | No | No | No |
| Merge | By key, 3-way | Automatic | Automatic | No | No |
| Two edits to one value | A conflict the app settles, or a rule | One wins, the other is kept as a conflict value | One wins | Not handled | Not handled |
| Restore one part of an old version | restore(from, part) | You copy it | No | No | No |
| Check the history | verify(): hashes and op logs | Changes are hashed | No | No | No |
| Live co-editing of text | No | Yes | Yes, its main use | No | No |
| Presence and other ticks | heddle/stream | Ephemeral messages in its sync layer | Awareness protocol | No | No |
| Saved format | JSON, readable, hash-named | Compact binary | Compact binary | Yours | Yours |
| History UI | mountHistory: timeline, graph, restore | No | No | No | No |
| Runtime dependencies | None | A WebAssembly module | A few small ones | None | Varies |
Read from each project's documentation in November 2026. Not tested by this repository. Corrections are welcome.
1,000 items, then 200 edits of one item each, every edit a version. bun run compare builds the same document in each library, applies the same seeded edits one at a time, then undoes 50 of them, saves the document with its history, loads it back, and measures what a peer missing the last edit would be sent. Each library is used the way its documentation shows for keeping history. Code shipped is the library's entry bundled for a browser, minified and gzipped, with any WebAssembly module included.
| Library | Edit, median | Undo, median | Saved with history | Load | One edit to a peer | Code shipped |
|---|---|---|---|---|---|---|
| Heddle, grouped state Version history of a JSON state | 1.8 ms | 0.146 ms | 1.5 MB | 11.6 ms | 6.3 kB | 11.3 kB |
| Heddle, flat state Version history of a JSON state | 1.8 ms | 0.337 ms | 16.5 MB | 111 ms | 81.2 kB | 11.3 kB |
| Automerge CRDT document with its full change history · 3.5 | 0.210 ms | not offered | 19.1 kB | 14.5 ms | 0.1 kB | 1.2 MB |
| Yjs CRDT document for live co-editing · 13.6 | 0.007 ms | 0.007 ms | 74.6 kB | 4.9 ms | 0.6 kB | 29.3 kB |
| Immer with patches Immutable updates that emit patches · 11.2 | 0.072 ms | 0.069 ms | 74.8 kB | 0.262 ms | 0.1 kB | 7.7 kB |
Measured 2026-11-12 on Bun 1.4, darwin arm64. Bars are on a log scale within each column: shorter is better. One state is 45.6 kB of JSON, and 201 full snapshots of it would be 9.2 MB.
Run it yourself: bun run compare [items] [edits] writes reports/compare/results.json, and the next site build prints it here. Heddle's own numbers over time are in the test lab.