Parallel diff and cmp on binary files?
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- rust
- 領域
- cli, performance
研究方向
未指定原始碼檔案、測試或特定進入點。先找出 diff 和 cmp 的二進位比較路徑,並將其目前的行為與回報的 b3sum 計時結果進行比較測量。在實作之前,定義平行處理適用於二進位檔案、目錄比較,還是兩者皆適用,並確定哪些基準測試和測試能夠證明這項變更已完成。
由索引模型根據 Issue 內容生成。
描述
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! :)
- 主要語言
- Rust
- 星號
- 276
- 分支
- 44
- 平均合併
- 1 天 23 小時
- 30 天內合併 PR
- 8
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
uutils/diffutils 的其他 Issue
-
cmp: quiet mode compares full file sizes before applying -n可能已有人在做 @SichenLiang 於 9 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
diff: `-y --tabsize=<huge>` overflows the column arithmetic (overflow-checks only)可能已有人在做 @sami-daniel 於 60 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
diff panics on an oversized inline context count (`-c`/`-u`/`-C`/`-U`): parse overflow and capacity overflow可能已有人在做 @MsfPablo 於 55 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
uutils/diffutils#245 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
sdiff: fix the layout of unchanged rows, blank lines and cut tabs可能已有人在做 @sami-daniel 於 6 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 28/100
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
swc-project/swc#12516 ·
維護者通常 1 天內回覆
-
mls-rs-crypto-awslc: exact aws-lc-rs =1.16.3 pin blocks rustls security update可能已有人在做 @muscariello 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
-
[work-item] adam-adae-worsening-emergence: conform spec.yaml to the specification style contract (REQ-1280)可能已有人在做 @muse-yamaa-bot 今天認領。 未關閉work-item
難度 1/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 63/100
metasequoiaime/msime#7328 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
eclipse-opensovd/classic-diagnostic-adapter#616 ·
維護者通常 2 天內回覆