comparison · 2026
Diffcore vs jsondiffpatchfast WASM diff with RFC 6902 Patch
tldr
Diffcore runs the diff in Rust compiled to WebAssembly, returns standard RFC 6902 JSON Patch with real RFC 6901 paths, ships applyPatch / revertPatch, a React useDiff hook, a CLI, and a streaming engine for multi-GB files. Benchmarks: 3.3 to 4.1× faster than optimized pure-JS diff. jsondiffpatch is the long-time pure-JS option with a custom delta format.
install
npm install diffcore
side by side
| Feature | Diffcore | jsondiffpatch |
|---|---|---|
| Engine | Rust + WebAssembly | Pure JavaScript |
| Throughput | 360–490 MB/s sustained | ~110–140 MB/s |
| Speed-up vs JS baseline | 3.3–4.1× faster | 1× (the baseline) |
| Diff format | Standard RFC 6902 JSON Patch | Custom delta format |
| Path format | Real RFC 6901 JSON Pointer | Custom path strings |
| applyPatch / revertPatch | Built-in, round-trip safe | patch / unpatch (custom) |
| React hook | useDiff (first-party) | None — bring your own |
| CLI | diffcore --json, --silent | None first-party |
| Streaming engine | Yes — multi-GB files | In-memory only |
| Runtimes | Node, Browser, Bun, Deno, CF Workers, Vercel Edge, Electron, Tauri | Node, Browser |
| WASM bundling | Embedded Base64 — zero config | N/A |
| Memory cleanup | Auto via FinalizationRegistry | Manual / GC |
| Last release | 2026-05 (active) | 2024-10 |
| License | MIT | MIT |
example
import { diff, applyPatch } from "diffcore";
const before = { user: { name: "Ada", roles: ["admin"] } };
const after = { user: { name: "Ada", roles: ["admin", "ops"] } };
const patch = diff(before, after);
// [ { op: "add", path: "/user/roles/1", value: "ops" } ]
const next = applyPatch(before, patch); // { user: { name: "Ada", roles: ["admin", "ops"] } }when to pick what
Pick Diffcore if you want standard RFC 6902 output (interoperable with any IETF-compliant consumer), need real React or CLI tooling, run on edge runtimes, or are diffing payloads big enough that JS speed matters.
Pick jsondiffpatch if you are already deep into its custom delta format and the visualizer / formatters that come with it, or if WebAssembly in your runtime is genuinely off the table.
faq
Is Diffcore faster than jsondiffpatch?
Yes — 3.3 to 4.1× on the same payloads, because the diff itself runs in Rust compiled to WebAssembly. Sustained throughput is 360–490 MB/s. The gap widens on large nested objects.
Does it emit standard RFC 6902 JSON Patch?
Yes. Real RFC 6901 paths, decoded values, interoperable with fast-json-patch, jsondiffpatch, and any IETF-compliant consumer.
Does it have a React hook?
useDiff returns the JSON Patch and decoded values for two state objects, with automatic memoization.
Can it handle multi-GB files?
Yes — the streaming engine diffs without holding both documents in memory.
try diffcore
Install from npm → or open the live demo →
Source on GitHub. Issues, PRs, and benchmark contributions welcome.
related
Other comparisons: Klinder-OSS vs PostHog · AHTML vs llms.txt · all projects
Thanks for reading. Love your work, keep it up!