You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been building a line-diff/3-way-merge engine in Rust and wanted to share an in-process benchmark against a few well-known implementations: jj-lib (ContentDiff, files::merge), libgit2/xdiff (git2::Patch, git2::merge_file), imara-diff (Histogram algorithm), and diffy.
Methodology: all engines run in-process (no subprocess spawning) on the same samples, pulled from real commit history across 4 repos (helix, vscode, rustc, linux) — ~5300 diff samples, ~5200 merge samples. Diff correctness is checked by reconstructing the target content byte-for-byte from each engine's own output and comparing to the real content.
Diff (2-way), total across all 4 repos:
Engine
Time (ms)
vs. mine
jj-lib
33671
0.11x
libgit2 (xdiff)
20513
0.18x
imara-diff (Histogram)
4363
0.85x
mine
3720
1.00x
All 4 engines reconstructed the target content byte-for-byte correctly on every sample.
3-way merge, total across all 4 repos (real base content + synthetic scattered non-overlapping edits on each side):
Engine
Time (ms)
vs. mine
jj-lib
62787
0.08x
libgit2 (merge_file)
14399
0.33x
diffy
10083
0.47x
mine
4757
1.00x
Happy to share more details on the approach or the benchmark setup if useful.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I've been building a line-diff/3-way-merge engine in Rust and wanted to share an in-process benchmark against a few well-known implementations:
jj-lib(ContentDiff,files::merge),libgit2/xdiff (git2::Patch,git2::merge_file),imara-diff(Histogram algorithm), anddiffy.Methodology: all engines run in-process (no subprocess spawning) on the same samples, pulled from real commit history across 4 repos (helix, vscode, rustc, linux) — ~5300 diff samples, ~5200 merge samples. Diff correctness is checked by reconstructing the target content byte-for-byte from each engine's own output and comparing to the real content.
Diff (2-way), total across all 4 repos:
All 4 engines reconstructed the target content byte-for-byte correctly on every sample.
3-way merge, total across all 4 repos (real base content + synthetic scattered non-overlapping edits on each side):
Happy to share more details on the approach or the benchmark setup if useful.
All reactions