Repository navigation
Conversation
- Replace the external `diff` crate dependency with the `ses` crate across all diff modules - Update pattern matching in context, ed, normal, side, and unified diff implementations to use `ses::Change` variants (`Delete`, `Insert`, `Equal`)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #418 +/- ##
===========================
===========================
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
empty lines are written without the blanks of their marker in the normal, context and unified formats. the context colors still apply to them.
|
sorry but it is unlikely that we will take add this dependency over similar |
|
That's what I want to know, since This crate is just temporary and for isolating the core algorithm from this repository (so I can research and play around), and it's small enough to be merged into |
c626797 to
143b9df
Compare
Merging this PR will degrade performance by 11.77%2 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
d661fee to
94f9bb6
Compare
…ls (uutils#384) * diff: count -t columns like a terminal after CR, backspace and controls * tests: port the -t control character test to uutests * utils: keep the do_expand_tabs doc comment in one piece * utils: let do_write_line write the line marker
- Check for identical content early in compare_files to bypass binary checks - Return empty output immediately in normal and unified diff generators when inputs are identical perf(utils): optimize file equality checks with sampling heuristic - Add `is_identical` helper to `utils` for O(1) early rejection of non-identical files - Sample tail, midpoint, and quarter points for large buffers ($\ge$ 256 bytes) before falling back to full comparison - Update diff modules (`diff`, `normal_diff`, `unified_diff`) to utilize the new optimized equality check - Add comprehensive unit tests covering empty, small, and large-buffer sampling rejections
94f9bb6 to
e3a3524
Compare
PR to evaluate
ses(Shortest Edit Script) for sequence comparison using Eugene Myers' diff algorithm, and to compare CodSpeedperformance and hunk compatibility against
mainand #415 (similar).sesis the minimal crate implementation of Myers' diff algorithm. https://github.com/shadowmkj/sesUnlike
similar,sesproduces hunks that are 1:1 compatible with GNU diff's alignments and tie-breaking .What changed:
diffcrate dependency withsesacrossnormal_diff,unified_diff,context_diff,ed_diff, andside_diff.tests/by-util/test_diff.rsverifying 1:1 GNU diff compatibility(symmetrical/asymmetrical ties, replacements, and boundary changes).