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

FeatureDiffcorejsondiffpatch
EngineRust + WebAssemblyPure JavaScript
Throughput360–490 MB/s sustained~110–140 MB/s
Speed-up vs JS baseline3.3–4.1× faster1× (the baseline)
Diff formatStandard RFC 6902 JSON PatchCustom delta format
Path formatReal RFC 6901 JSON PointerCustom path strings
applyPatch / revertPatchBuilt-in, round-trip safepatch / unpatch (custom)
React hookuseDiff (first-party)None — bring your own
CLIdiffcore --json, --silentNone first-party
Streaming engineYes — multi-GB filesIn-memory only
RuntimesNode, Browser, Bun, Deno, CF Workers, Vercel Edge, Electron, TauriNode, Browser
WASM bundlingEmbedded Base64 — zero configN/A
Memory cleanupAuto via FinalizationRegistryManual / GC
Last release2026-05 (active)2024-10
LicenseMITMIT

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

Thanks for reading. Love your work, keep it up!