[GH-ISSUE #112] Use of -d flag should not change calculated sizes #45

Closed
opened 2026-06-08 11:25:26 +03:00 by zhus · 2 comments
Owner

Originally created by @rylwin on GitHub (Sep 3, 2020).
Original GitHub issue: https://github.com/bootandy/dust/issues/112

I was giving dust a try and noticed that the use of the -d flag changes the displayed sizes of the directories, whereas I would have expect each directory to be the same size, but with fewer sub-levels displayed. Is this the expected behavior, a bug, or user error?

Here's the output of the dust repo after cloning it, comparing du, dust -bd1, and dust -b (using -b for more readable output below):

$ du -d 1 -h | sort -h
24K	./ci
24K	./.github
52K	./src
68K	./media
84K	./tests
552K	./.git
153M	./target
154M	.

$ cargo run -- -bd1
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/dust -bd1`
 4.0K   ┌── README.md
 4.0K   ├── Cargo.toml
 4.0K   ├── .gitignore
 8.0K   ├── .github
  12K   ├── LICENSE
  16K   ├── target
  24K   ├── ci
  24K   ├── Cargo.lock
  32K   ├── src
  40K   ├── .git
  52K   ├── tests
  68K   ├── media
 292K ┌─┴ .

$ cargo run -- -b  
    Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/dust -b`
 948K             ┌── query-cache.bin
 3.9M             ├── dep-graph.bin
  10M           ┌─┴ s-fqutna58o2-1mf6920-1dfcidj0qrb4
  10M         ┌─┴ dust-1u7onte9p4g5s
  10M       ┌─┴ incremental
 2.8M       │   ┌── build_script_build-95c8841d5eeef07a
 2.8M       │ ┌─┴ log-95c8841d5eeef07a
 2.8M       │ │ ┌── build_script_build-98b6810859c9cb39
 2.8M       │ ├─┴ memchr-98b6810859c9cb39
 3.1M       │ │ ┌── build-script-build
 3.1M       │ ├─┴ bitflags-5ac1d02a416a61b2
 3.2M       │ │ ┌── build_script_build-9091c386f088b04c
 3.2M       │ ├─┴ libc-9091c386f088b04c
 3.5M       │ │ ┌── build-script-build
 3.5M       │ ├─┴ crossbeam-utils-408f2589721c053b
  15M       ├─┴ build
 912K       │ ┌── libtextwrap-1a0030a681f6ac5d.rlib
 1.0M       │ ├── libregex-818c9001a7df9eb5.rmeta
 1.0M       │ ├── libaho_corasick-39d24709df92682f.rmeta
 1.1M       │ ├── libstrsim-c37e1feb7d72bc60.rlib
 1.3M       │ ├── libnum_cpus-7c7ca82d2b6385a6.rlib
 1.4M       │ ├── liblscolors-d48fed5629317cfd.rlib
 1.5M       │ ├── libbstr-8fff9e7d83cfd68c.rlib
 1.6M       │ ├── libwalkdir-d08a403e2772aeb4.rlib
 1.6M       │ ├── libcrossbeam_utils-4e0e4e297bcafc8b.rlib
 1.6M       │ ├── libautocfg-b11cbca6ecbb3954.rlib
 1.7M       │ ├── liblibc-c64d0ff9390f98b5.rmeta
 1.7M       │ ├── libclap-aeb92d621b503b05.rmeta
 1.8M       │ ├── libcrossbeam_channel-7116bcca9ad76a0b.rlib
 2.0M       │ ├── liblibc-c64d0ff9390f98b5.rlib
 4.9M       │ ├── libaho_corasick-39d24709df92682f.rlib
 5.2M       │ ├── libregex_syntax-d37ef5e024ea9658.rmeta
 6.0M       │ ├── libglobset-3998d750ef9972f8.rlib
 8.8M       │ ├── libignore-92c56c21ac8db7b8.rlib
  10M       │ ├── libregex-818c9001a7df9eb5.rlib
  13M       │ ├── libregex_syntax-d37ef5e024ea9658.rlib
  16M       │ ├── libclap-aeb92d621b503b05.rlib
  31M       │ ├── dust-321965f5bb0f1679
 125M       ├─┴ deps
 152M     ┌─┴ debug
 152M   ┌─┴ target
 153M ┌─┴ .
Originally created by @rylwin on GitHub (Sep 3, 2020). Original GitHub issue: https://github.com/bootandy/dust/issues/112 I was giving dust a try and noticed that the use of the `-d` flag changes the displayed sizes of the directories, whereas I would have expect each directory to be the same size, but with fewer sub-levels displayed. Is this the expected behavior, a bug, or user error? Here's the output of the dust repo after cloning it, comparing `du`, `dust -bd1`, and `dust -b` (using -b for more readable output below): ``` $ du -d 1 -h | sort -h 24K ./ci 24K ./.github 52K ./src 68K ./media 84K ./tests 552K ./.git 153M ./target 154M . $ cargo run -- -bd1 Finished dev [unoptimized + debuginfo] target(s) in 0.02s Running `target/debug/dust -bd1` 4.0K ┌── README.md 4.0K ├── Cargo.toml 4.0K ├── .gitignore 8.0K ├── .github 12K ├── LICENSE 16K ├── target 24K ├── ci 24K ├── Cargo.lock 32K ├── src 40K ├── .git 52K ├── tests 68K ├── media 292K ┌─┴ . $ cargo run -- -b Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/dust -b` 948K ┌── query-cache.bin 3.9M ├── dep-graph.bin 10M ┌─┴ s-fqutna58o2-1mf6920-1dfcidj0qrb4 10M ┌─┴ dust-1u7onte9p4g5s 10M ┌─┴ incremental 2.8M │ ┌── build_script_build-95c8841d5eeef07a 2.8M │ ┌─┴ log-95c8841d5eeef07a 2.8M │ │ ┌── build_script_build-98b6810859c9cb39 2.8M │ ├─┴ memchr-98b6810859c9cb39 3.1M │ │ ┌── build-script-build 3.1M │ ├─┴ bitflags-5ac1d02a416a61b2 3.2M │ │ ┌── build_script_build-9091c386f088b04c 3.2M │ ├─┴ libc-9091c386f088b04c 3.5M │ │ ┌── build-script-build 3.5M │ ├─┴ crossbeam-utils-408f2589721c053b 15M ├─┴ build 912K │ ┌── libtextwrap-1a0030a681f6ac5d.rlib 1.0M │ ├── libregex-818c9001a7df9eb5.rmeta 1.0M │ ├── libaho_corasick-39d24709df92682f.rmeta 1.1M │ ├── libstrsim-c37e1feb7d72bc60.rlib 1.3M │ ├── libnum_cpus-7c7ca82d2b6385a6.rlib 1.4M │ ├── liblscolors-d48fed5629317cfd.rlib 1.5M │ ├── libbstr-8fff9e7d83cfd68c.rlib 1.6M │ ├── libwalkdir-d08a403e2772aeb4.rlib 1.6M │ ├── libcrossbeam_utils-4e0e4e297bcafc8b.rlib 1.6M │ ├── libautocfg-b11cbca6ecbb3954.rlib 1.7M │ ├── liblibc-c64d0ff9390f98b5.rmeta 1.7M │ ├── libclap-aeb92d621b503b05.rmeta 1.8M │ ├── libcrossbeam_channel-7116bcca9ad76a0b.rlib 2.0M │ ├── liblibc-c64d0ff9390f98b5.rlib 4.9M │ ├── libaho_corasick-39d24709df92682f.rlib 5.2M │ ├── libregex_syntax-d37ef5e024ea9658.rmeta 6.0M │ ├── libglobset-3998d750ef9972f8.rlib 8.8M │ ├── libignore-92c56c21ac8db7b8.rlib 10M │ ├── libregex-818c9001a7df9eb5.rlib 13M │ ├── libregex_syntax-d37ef5e024ea9658.rlib 16M │ ├── libclap-aeb92d621b503b05.rlib 31M │ ├── dust-321965f5bb0f1679 125M ├─┴ deps 152M ┌─┴ debug 152M ┌─┴ target 153M ┌─┴ . ```
zhus closed this issue 2026-06-08 11:25:26 +03:00
Author
Owner

@bootandy commented on GitHub (Sep 3, 2020):

that looks like a bug. Well found.

<!-- gh-comment-id:686753552 --> @bootandy commented on GitHub (Sep 3, 2020): that looks like a bug. Well found.
Author
Owner

@bootandy commented on GitHub (Sep 3, 2020):

Seems to be caused by moving crates to ignore from jwalk by: 1953e107.

<!-- gh-comment-id:686756779 --> @bootandy commented on GitHub (Sep 3, 2020): Seems to be caused by moving crates to ignore from jwalk by: 1953e107.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#45