Benchmarking the crate diff-match-patch-rs against other implementations.
| Lang. | Library | Diff Avg. | Patch Avg. | Bencher | Mode | Correct |
|---|---|---|---|---|---|---|
rust |
diff_match_patch v0.1.1** | 68.108 ms | 10.596 ms | Criterion | - | ✅ |
rust |
diffmatchpatch v0.0.4*** | 66.454 ms | - | Criterion | - | ❌ |
rust |
dmp v0.2.0 | 69.019 ms | 14.654 ms | Criterion | - | ✅ |
rust |
diff-match-patch-rsour | 64.66 ms | 631.13 µs | Criterion | Efficient |
✅ |
rust |
diff-match-patch-rsour | 64.68 ms | 1.1703 ms | Criterion | Compat |
✅ |
go |
go-diff | 50.31 ms | 135.2 ms | go test | - | ✅ |
node |
diff-match-patch | 246.90 ms | 1.07 ms | tinybench | - | ❌ |
python |
diff-match-patch^ | 1.01 s | 0.25 ms | timeit | - | ✅ |
Note: Omitting dissimilar from the results, I believe that crate has different goals and a headon benchmark is not fair Results: Avg[197.30] High[197.46] Low[197.19]
**Adds an extra clone to the iterator because thepatch_applymethod takes mutable refc. todiffs
***The crate diffmatchpatch v0.0.4 is still a WIP, cound't find thepatch_applymethod
^Most JS based crates fail at unicode surrogates, the generated diffs are not compatible with other implementations. The JS based variants with theunicode surrogatefix breaks for implementations in other languages