Spekter

Spekter is a GUI for diffing files and recursive directory trees. It tries to feel instant: tabs open immediately, file content appears at once, and the diff colouring fills in progressively in the background instead of blocking the view.

Spekter directory comparison view, with two trees side by side and differing files highlighted
Two directory trees side by side. Changed files are highlighted; a struck-through grey name means the file is missing on that side.

Why «instant»

The motivation is simple. Visual diff tools like Meld are wonderful, but on large directory trees they can spend several seconds churning before anything appears. Spekter is built around the opposite ordering: show what you already have, then keep computing in the background. Opening a comparison of a 50 000-file tree is not really different from a 10-file tree: the window appears, the tree fills in, and you can start clicking before the recursive hash check has finished.

Three small choices make this work: file content is read and rendered before any colour-coding is computed, the diff algorithm (imara-diff’s histogram variant) runs on a worker thread, and a filesystem watcher picks up external changes without you having to reopen the comparison.

The choice of imara-diff matters here. It’s one of the fastest diff libraries in the Rust ecosystem: its histogram algorithm runs 10–100 % faster than the classic Myers algorithm across a wide range of workloads, and on complex diffs the more commonly used similar crate falls so far behind that the comparison charts on imara-diff’s crates.io page have to use a logarithmic scale. The benchmarks there are run against real repositories (Linux kernel, Rust compiler, VSCode, the Helix editor), so the numbers reflect actual diffing work rather than toy inputs.

Spekter side-by-side diff view, with inline character-level highlighting and Bezier gutter connectors
Side-by-side diff with inline character-level highlighting and Meld-style Bezier gutter connectors.

Beyond a Meld lookalike

The basics are familiar: side-by-side and unified views, synchronized scrolling, character-level inline highlights, tabs, Bezier gutter connectors between hunks. A few features came out of practical use:

Spekter showing a JSON array where the two sides have the same items in a different order, marked as a re-ordering rather than a normal diff
JSON order detection: same items in a different order, marked as a re-ordering instead of a wall of red and green.

Terminal mode for headless environments

Spekter ships a second binary, spekter-nw, that does the same diff work without opening a window. Same comparison logic, same colour-coded output, but rendered to your terminal instead. Useful over SSH, in a remote CI shell, or just when you’d like to pipe a diff into less.

spekter-nw /path/to/old /path/to/new

Both binaries share the diff core, so a side-by-side comparison in the GUI and a quick spekter-nw on the command line will agree about what differs.

Get Spekter