TwKit
正在载入
TwKit

I made a 1GB file that takes up 0 bytes on disk. Then I ran diskus on it. It s… · @ReignSwords · TwKit

@ReignSwords

I made a 1GB file that takes up 0 bytes on disk. Then I ran diskus on it. It said 0. Then I ran diskus -b. It said 1,073,741,824. Both were right. diskus is a parallel du -sh written in Rust. One job: tell you how big a folder is. I pointed it at my own stuff this morning. 1. Small folder, 1,037 files, 488MB: du -sh took 6ms, diskus 8ms. The "10x faster" claim doesn't show up here. du won by 2ms. 2. My whole workspace, 1,082,495 files, 108G: du took 5.5 to 18 seconds across runs. diskus took 7.6 to 9.5. A tie on warm cache. du's first run took 142 seconds, so cold cache is where the pain lives — but I couldn't drop caches in this sandbox, so diskus's cold-cache advantage stays unproven on my box. The 10x claim didn't reproduce here. 3. diskus -b and du -sb agreed to the byte: 509,327,932. Default diskus counts directory entries too, so it reads 2,340,292 bytes higher. Same folder, two honest answers to two different questions. 4. The sparse file is the real lesson. truncate -s 1G sparse.bin makes a file ls calls 1GB. It holds nothing, so it uses 0 bytes of disk. diskus says 0. diskus -b says 1,073,741,824. If you've ever wondered why "disk full" and "my files add up to less" disagree, this is why. Verdict: keep du for quick checks. Reach for diskus when the tree is big, the cache is cold, or you actually need the -b number. Free, one binary, no config. If you live in a terminal, stick around — I test one of these a day. When's the last time du and your file manager disagreed, and which one did you believe? 🔵 Fellow Premium members, let's connect! I post about AI & tech — follow for more 👥

曝光 93 · 评论 7 · 点赞 1 · 书签 0

查看原帖