Tomasz Wegrzanowski wrote:
I'm doing character-level diffs in my bot, for deep reverts, and I found that printing two revisions to files, one character per line (escaped of course), running GNU diff, and parsing the result, is extremely fast.
It took Algorithm::Diff about 7 minutes to do what GNU diff did in less than 1 second.
So GNU diff must be doing the right thing that we should simply copy, instead of recoding Algorithm::Diff in C++.
I had a look into the GNU diffutils documentation. Currently GNU diff is based on the O((n+m)*D) algorithm by Myers. I think Algorith::Diff uses the the classic O(n*m) algorithm.
Greetings, Jakob