Michael Hamann I tested https://github.com/gliese1337/fast-myers-diff for XWIKI-22034 where I also rely on diff to be able to perform a 3-way merge client-side, and the results I got were very disappointing... I published the WebJar https://central.sonatype.com/artifact/org.webjars.npm/fast-myers-diff so you can install and try it yourself. I'm using it like this:
For two input strings of 15.6 KB and 22.7 KB respectively (see the attached files), where the second string has only additions I got this:
- Firefox:
- Fast Myers Diff: 26 s and it finds 82 changes
- ChainPad Diff: 9 s and it finds 24 changes
- Chrome
- Fast Myers Diff: 0.9 s and it finds 82 changes
- ChainPad Diff: 0.7 s and it finds 24 changes
So, it's slower than the implementation of ChainPad (almost 3x slower on Firefox) and it produces a suboptimal edit script (almost 3x longer). What puzzles me is the significant speed difference between Firefox and Chrome. I don't understand how Firefox can be so slow, more than 10x slower... For the suboptimal edit script there is https://github.com/gliese1337/fast-myers-diff/issues/17 . Sure, maybe this is just one example where it behaves poorly, but it certainly doesn't give me a good impression. |