DEV Community

Javier Leandro Arancibia
Javier Leandro Arancibia

Posted on

I built a 100 KB git-like VCS that beats git on `add && commit`

I love git. I also spend a lot of time automating things, and every time a script needs to snapshot some files I end up wrapping git with brittle flags and parsing porcelain output. So I wrote lume: a tiny, content-addressed version control system in machin/MFL.

lume is git-like, not git-based. It uses blobs, trees, commits, refs, and HEAD, but the storage, object format, and HTTP protocol are built from scratch. The whole thing compiles to a single 100 KB native binary.

The benchmark that surprised me

I compared the one workflow every developer repeats all day:

  • lume add . && lume commit -m "x"~15 ms
  • git add . && git commit -m "x"~17 ms

On 110 small files, lume is faster. The lume binary is ~36× smaller than git (100 KB vs 3.7 MB), and the .lume metadata is within 2% of .git.

Where the speed comes from

The biggest win was replacing the SQLite staging index with a line-delimited file. lume add now builds a small tab-separated string and writes it once. Object subdirectories are created lazily, and blobs use a hand-rolled JSON fast path instead of generic serialization.

HTTP push / pull / clone out of the box

lume serve starts a tiny HTTP object server. push, pull, and clone speak plain JSON-over-HTTP. No SSH keys, no pack negotiation, no stateful transport.

What's next

Merge, rebase, and diff are still missing, and the tooling is Linux-oriented right now. But the core agent loop — init, add, commit, push, pull, clone — is fast enough to run behind automation without the automation ever knowing it is talking to a VCS.

I wrote a longer post with the architecture and numbers on the Intrane blog.

Source, benchmarks, and build instructions are on GitHub: github.com/javimosch/lume

Top comments (0)