Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Automatic-Mode" - powered by PDU prune and display only high-value targets in interactive mode #93

Open
Byron opened this issue Jun 4, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@Byron
Copy link
Owner

Byron commented Jun 4, 2021

That way one can seriously cut down the time it takes to find what is even worth deleting. As much fun as browsing the file tree might be it's faster to have pdu prepare the tree for you.

Ways of invoking pdu

  • use pdu as library with corresponding feature flags
  • use pdu as binary and output json

The latter is preferred to not increase build times of dua.

@KSXGitHub
Copy link

KSXGitHub commented Jun 4, 2021

Beware of 2 things:

  • The name of the tree root is not always a real file: When pdu takes 2 arguments or more, it becomes (total).
    • Workaround: Provide no more than 1 argument.
  • The tree is not always full: When --min-ratio (default: 0.01) is greater than 0, files and directories whose relative size is under the required ratio won't appear.
    • Workaround: Always specify --min-ratio=0.

@Byron
Copy link
Owner Author

Byron commented Jun 4, 2021

Thank you. Especially the first point might have been a foot gun.

@KSXGitHub
Copy link

The latter is preferred to not increase build times of dua.

Both options have pros and cons.

Using the parallel_disk_usage library crate would eliminate runtime dependency on the pdu command, provide competitive performance (JSON serialization/deserialization has runtime cost), and allowing you to reuse existing JSON struct instead of reinventing the wheel. The only cost I can think of right now is greater compile time and binary size.

Using the pdu command is the UNIX way. The pros and cons of this option is the opposite of the library option.

@KSXGitHub
Copy link

Another note is that the structure of the JSON is not final. You may subscribe to KSXGitHub/parallel-disk-usage#27 and KSXGitHub/parallel-disk-usage#28 for potential changes.

@Byron
Copy link
Owner Author

Byron commented Jun 5, 2021

Another note is that the structure of the JSON is not final. You may subscribe to KSXGitHub/parallel-disk-usage#27 and KSXGitHub/parallel-disk-usage#28 for potential changes.

Thank you, that will definitely help.

@Byron
Copy link
Owner Author

Byron commented Jun 5, 2021

Needs KSXGitHub/parallel-disk-usage#28 (comment) to continue.

@Byron Byron moved this to Backlog in Open-Source Work Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants