I Got Obsessed With 2-Byte Deltas and Built a Delta Compressor That Actually Hits Them
dev.to·1d·
Discuss: DEV
Custom Rule Development
Preview
Report Post

TL;DR: Needed tiny deltas for an encrypted document format. xdelta3 uses 40+ bytes for simple edits. Built xpatch with 7 specialized algorithms and a tag system that references old versions. Result: median delta of 2 bytes on real code repositories. Yes, 2 bytes. Tested on 1.2 million real-world changes. It’s fast as hell and actually works.


The median delta is 2 bytes.

Not a typo. Two bytes. That’s a uint16. That’s the header plus literally nothing else because the files being compared are identical and the algorithm just says "hey, go look at version 5, it’s the same."

Let me show you how I ended up here, because it started with a much simpler problem and turned into a three-week rabbit hole that I’m genuinely excited about.

The Problem That Broke Me

I’m…

Similar Posts

Loading similar posts...