Afterglowscreensavers

Live Diff Visualizer Screensaver

The Live Diff Visualizer screensaver runs a real line-based diff algorithm on two evolving text blocks, marking real additions, deletions and unchanged lines. It is free, runs in your browser, and ESC exits.

Live preview

Live Diff Visualizer screensaver — A real line-diff algorithm, comparing text live.

Press ESC to leave fullscreen. Settings are saved in your browser only.

How the Live Diff Visualizer screensaver works

The saver keeps two versions of a small text block and computes their real longest-common-subsequence-based line diff.

Lines present in both versions are marked unchanged; lines only in the new version are marked as real additions, and lines only in the old one as real deletions.

Every few seconds a real random edit — an insert, delete or line change — is applied to the new version, and the diff recomputes live.

The updated diff redraws immediately, so you watch genuinely new additions and deletions appear as the text keeps evolving.

How diff finds the changes between two texts

A diff tool compares two versions of a text and reports a small set of insertions and deletions that turns one into the other. The idea of a minimal edit is linked to the longest common subsequence problem: find the longest sequence of lines that appear in both versions in the same order, and everything else must be an addition or a deletion.

The textbook way to solve it uses dynamic programming, filling a table whose entries record the longest common subsequence for each pair of prefixes and tracing back to read off the edits. In 1976 James Hunt and Douglas McIlroy described the algorithm behind the Unix diff, treating the task as a longest-common-subsequence problem. In 1986 Eugene Myers published “An O(ND) Difference Algorithm and Its Variations”, whose running time depends on the size of the edit script, so it is fast when versions are similar. Myers’ algorithm is Git’s default.

A diff is not a unique answer. When lines move or are repeated, several different sets of edits can be equally short, and different algorithms may choose different ones. A diff also has no sense of meaning: a block that has moved elsewhere appears as a deletion plus an addition, unless the tool has special move detection.

A worked example

Inserting a single new line shifts every line below it down by one, and the real diff correctly marks only that one line as added, leaving the rest correctly matched as unchanged.

Settings & tips

Frequently asked questions

Is this a real diff algorithm?
Yes — a real longest-common-subsequence-based line diff, the same family of algorithm real version-control tools use.
Where does the text come from?
A small embedded sample block, randomly edited line by line so the diff has something genuine to compare each cycle.
Is a key needed?
No — it is a pure local computation.
Is it free?
Yes — free, no download, in your browser.
What is the longest common subsequence?
It is the longest list of items that appears in both inputs in the same order, though not necessarily next to each other. A diff treats those as unchanged and everything else as changed.
Which diff algorithm does Git use?
By default it uses Myers’ algorithm. Git also offers minimal, patience and histogram options through --diff-algorithm, which can produce more readable results for some kinds of change.
Why does a moved paragraph show as removed and added?
Basic line diff compares order and has no concept of relocation. It sees the text missing in one place and appearing in another.

← All Science & Research screensavers