implement Meyers diffing algorithm
See original GitHub issueSo we have a slight diffing problem — not only are we fairly slow at updating, reordering nodes is also suboptimal. This means that some reorders can be surprising at the worst case, and in a worst case reorders simply take longer than they should.
In computer science this is known as “diffing”, and is a rather well-studied problem. Probably the best known algo for this is the Mayers Diffing algorithm. It’d be neat if we could make use of this for nanomorph
.
references
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:31 (17 by maintainers)
Top Results From Across the Web
The Myers diff algorithm: part 1 - The If Works
The idea behind the Myers algorithm is quite simple: we want to get from (0,0) to (7,6) (the bottom-right) in as few moves...
Read more >Myers Diff Algorithm - Code & Interactive Visualization - Blog
Step 8) Improving Myers' Algorithm: Circular V Array · Step 1) Form A Grid Using The Two Strings · Step 2) Diagonals Denote...
Read more >An implementation of the Myers diff algorithm · GitHub
An implementation of the Myers diff algorithm. GitHub Gist: instantly share code, notes, and snippets.
Read more >The Myers Difference Algorithm - Nathaniel W. - Wroblewski
His algorithm improved the popular diff utility, a data comparison tool that displays the smallest set of line-by-line deletions and insertions to transform...
Read more >Myers' Diff Algorithm : The basic greedy algorithm
The algorithm is iterative. It calculates the furthest reaching paths on each k line for successive d . A solution is found when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Heya! 🎉 Following this long time. And as i once mentioned, i once wanted to rewrite it from scratch - for learning, playing and minimizing the size. So code name was “minmorph” - removed the “./events” list, the remaining is almost the same with few optimizations. Actually not sure why we need to list all the events?
Long story short, back then i tested it against nanomorph’s tests and only 1 tests was failing. Recently was touching it more and following the need for benchmarking, i got the @graforlock repo and put it there so we can benchmark. Also added the
nanomorph
s tests.And so, the result is all of the normal tests are passing and only 8 of the “keyed” tests are failing! The benchmark results are phenomenal 😃 I’m going to create a clean repo with everything, plus @graforlock’s code and benchmark. Then i’ll PR the implementation so we can discuss and continue on fixing these 8 tests, because i’m not so familiar with the
keyed
things 😄The tests are green (almost)
minmorph benchmark - numbers are the same as the @graforlock’s not finished code, which in turn fails pretty much tests.
Nanomorph benchmark
@brucou hey! – I’ve casually started working on a WASM version, but there’s no ETA when this might be done.