Parallel diff and cmp on binary files?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- rust
- Domain
- cli, performance
Research direction
No source files, tests, or specific entry points are named. Start by locating the binary comparison paths for diff and cmp and measure their current behavior against the reported b3sum timings. Before implementation, define whether parallelism applies to binary files, directory comparisons, or both, and what benchmarks and tests would establish that the change is done.
Written by the indexing model from the issue text.
Description
I just had a revelation:
$ time b3sum dreamshaper_8\ \(1\).safetensors dreamshaper_8.safetensors
771c807db56dbfc33feda5638d920f6c507db971da44772ee44a08dc38c3b437 dreamshaper_8 (1).safetensors
771c807db56dbfc33feda5638d920f6c507db971da44772ee44a08dc38c3b437 dreamshaper_8.safetensors
real 0m0.172s
user 0m2.193s
sys 0m0.423s
$ time cmp dreamshaper_8\ \(1\).safetensors dreamshaper_8.safetensors
real 0m0.596s
user 0m0.183s
sys 0m0.411s
$ time diff dreamshaper_8\ \(1\).safetensors dreamshaper_8.safetensors
real 0m0.509s
user 0m0.079s
sys 0m0.428s
As you can see, even though the b3sum method has an additional cost (calculating a hash) it is way faster overall since it's leveraging parallelism.
Wouldn't it be a good improvement to bring parallelism to some of the tools like diff and cmp?
Maybe with a new (not-standardized) option?
Maybe by default because why not?
I guess diff has a special code path once it is sure that it's just a binary file, right? So in that code path it wouldn't be much of a problem to parallelize it.
This whole topic can even be pushed further when comparing directories... parallel diffing of files.
Come on it's 2025! :)
- Dominant language
- Rust
- Stars
- 276
- Forks
- 39
- Avg merge
- 3h 27m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/diffutils
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
All issues in uutils/diffutils
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100