The Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronising plain text. This repository contains a Rust version of the original diff-match-patch library, using up-to-date crate packages.
Chars(Vec<char>)
to represent text instead of String
to avoid unnecessary traversing of the stringdiff_lines_to_chars
to diff_any_to_chars
to support lines, text blocks, any sequence of comparable itemsThis code is forked originally from dmp, licensed under the MIT license.
text
Python3 Elapsed Time: 8.695004s
JS(Chrome) Time: 0.469s
speedtest time: 147.20 ms