Skip to Content
New: codec-png-native and codec-png-wasm bring the blazediff-png codec to Node and WebAssembly, faster than spng and jSquash. Read more β†’
Comparevs microdiff

BlazeDiff vs microdiff

@blazediff/object is ~9% faster than microdiff over our 8 object shapes, and it returns the same kind of result: a flat list of changes, each with a path. Most of that gain comes from large arrays, identical ones above all. On small, flat objects microdiff is faster, so check the per-fixture table for the shapes you diff.

microdiff is a tiny, zero-dependency object diff that runs everywhere. BlazeDiff started from the same idea and adds a fixed result shape. Every entry has type, path, value and oldValue, which keeps the V8 object shape stable in hot loops.

At a glance

microdiffBlazeDiff (@blazediff/object)
LicenseMITMIT
SizeUnder 1 KBZero dependencies
RuntimesNode, Deno, Bun, browsersNode, Deno, Bun, browsers
Change typesStrings: "CREATE", "REMOVE", "CHANGE"Numbers: 0 create, 1 remove, 2 change
Entry shapevalue and oldValue only when relevantAlways type, path, value, oldValue
Cycle handlingcyclesFix (default on)detectCycles (default on)
Rich typesDate, RegExp, boxed primitives, TemporalDate, RegExp

Benchmarks

Object (@blazediff/object vs microdiff)

TOTAL TIME Β· 8 FIXTURES Β· MEAN OF 10000 RUNS Β· IO EXCLUDED

BlazeDiffOther librariesLower is better

Apple M1 Max Β· darwin/arm64 Β· Node v22.14.0 Β· rustc 1.97.1 (8bab26f4f 2026-07-14) Β· 2026-10-22 Β· 234b300-dirty Β· pnpm benchmark object

Per-fixture results (8)
FixtureMicrodiffBlazeDiffBlazeDiff vs Microdiff
complex object - tag addition0.00ms0.00ms1.31x
deep nested - timeout change0.00ms0.00ms0.93x
large array - single item change0.27ms0.24ms1.16x
large identical arrays0.06ms0.00ms15.69x
large nested object - multiple small changes1.59ms1.50ms1.06x
nested object - theme change0.00ms0.00ms1.16x
simple object - age change0.00ms0.00ms0.58x
simple object - identical0.00ms0.00ms0.85x
TOTAL1.92ms1.74ms1.10x

Switching

The call is the same. Compare type against numbers instead of strings.

// Before import diff from "microdiff"; const changes = diff(oldObj, newObj, { cyclesFix: false }); const added = changes.filter((c) => c.type === "CREATE"); // After import diff from "@blazediff/object"; const changes = diff(oldObj, newObj, { detectCycles: false }); const added = changes.filter((c) => c.type === 0);

When to keep microdiff

  • Bundle size is your first constraint.
  • You mostly diff small, flat objects, where microdiff wins in our runs.
  • You diff Temporal values.
  • Your code reads the string change types and you do not want to touch it.
Last updated on