HN Hall of Fame Weekly email

The Myers diff algorithm: part 1

blog.jcoglan.com Essays & writing Essays & articles Computer science Candidate
Screenshot of blog.jcoglan.com captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 4 calendar years, with breakout response in 3 of them.

submissions
4
submitters
4
observed span
2017–2026
peak thread · 23 comments
148 pts
latest 20+ return · 2024-03-13
148 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

Good to see this interesting and very fundamental topic getting attention, and looking forward to the next post, where hopefully the algorithm's cleverness will be explored. >It does this by being greedy, that is trying to consume as many lines that are the same before making a change (therefore avoiding the “wrong end” problem), and also by preferring deletions over insertions when given a choice, so that deletions appear first. Not really. The algorithm guarantees to find an alignment/diff/edit script…

There's also patience diff[1], which does a better job in some situations[2] (you might not normally see these inferior diffs because the diffs are massaged after the LCS algorithm). [1]: http://alfedenzo.livejournal.com/170301.html [2]: http://bramcohen.livejournal.com/73318.html

zamalek·148-point thread·

By the way, git also comes with other diff algorithms which may give cleaner diffs than the default one https://gist.github.com/roryokane/6f9061d3a60c1ba41237 Those alternative algorithms can be requested with command line flags like "git diff --histogram" or "git diff --patience". The default algorithm can also be changed via the git config file.

ufo·122-point thread·

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
3

100+ points or 50+ comments

Total points
419

reference only — not used in Hall rules or ranking

Total comments
53

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2017-02-23The Myers diff algorithm: part 1First breakoutarunc14815
2020-05-30The Myers diff algorithm that is used in Git (2017)dgudkov12215
2024-03-13The Myers diff algorithm: part 1Best thread · Latest 20+ point returnfrankjr14823
2026-05-14The Myers Diff Algorithmchirau10