Comments (5)
Thanks for reporting.
What matters here is that lstat
calls are very slow, which is run nearly unconditionally whenever an entry is entered. This is merely to detect presence, as it will highlight entries that aren't present anymore in red. This also means it won't detect type changes, i.e. dir to flie or vice-versa.
Maybe there is a fee to be paid when the lstat
call goes though longer paths, which is probably why there is a difference between ls
and the way this works here.
To fix it, one could probably just add a flag that prevents these lstat
checks entirely. Independently of that, one could try to to speed up the procedure by doing a directory listing instead through which metadata might come back faster. But that's to be validated.
I will implement the command-line flag to disable this behaviour, but also encourage you to see if read_dir
+ DirEntry::metadata()
is faster than a bunch of symlink_metadata()
calls on the known entries in a directory. If that's the case, a contribution of that algorithm would make it faster for everyone even if that flag isn't used.
from dua-cli.
When thinking about this use-case I can also think of another improvement: How useful would it be to be able to dump the graph in some format, say JSON, so it could be made accessible by other tooling? Waiting 8 hours for something that is lost when hitting q
seems like waste to be avoided.
From there I could absolutely imagine to add additional sub-commands that can handle these snapshot files, to compute changes between them for example. The simplest case would probably be to be able to use the UI to visualise such a snapshot, instead of re-scanning the underlying tree.
Maybe @piotrwach is interested in this as well :).
from dua-cli.
Mitigated in https://github.com/Byron/dua-cli/releases/tag/v2.28.0 .
from dua-cli.
@Byron Yes, I may be interested :) Depending on how it is implemented I think dua could then also be used for analysing directory trees from other sources, like for example S3,. E.g. all that would be required is to dump the object listing in the right format:
<name> <size> <mtime>
Such file then could be loaded in dua in interactive mode. What this would potentially also allow is interactively analysing file systems on other machines without actually running dua
there: ssh remote-server find /directory/to/scan -t f | dua i --from-traversal
from dua-cli.
I absolutely love your thoughts! With this feature, dua i
would become a front-end for viewing and organizing a graph data structure, which of course can also be created by other tools then.
ssh find⦠| dua i --from-traversal
seems like a separate feature though as that new data structure wouldn't be involved directly. I also don't see how a simple find
would produce all the data that's needed per entry, which I find critical to make this 'remote crawler that isn't dua
' scenario work (after all, if dua
was on the remote one could just use that). However, if that could be made to work, that would definitely be a nice feature to have as well.
For the terminal application input now is just a stream of events, and it doesn't have to care at all about their source anymore.
from dua-cli.
Related Issues (20)
- How to set the user default config?
- After using "dua i", how to move files or folders that do not need to be deleted?
- APFS Clones Support
- dua (non interactive) lost its ability to process files HOT 3
- Multiple dirs in --ignore-dirs not working as expected HOT 8
- Test fails on 32-bit targets HOT 1
- Duplicate key input on Windows since v2.23.0 HOT 5
- termion backend no longer works HOT 2
- Large graphs question
- Feature: Show modification date while sorted by size. HOT 4
- Feature: show free space on current mount point HOT 1
- ARM build can't execute on `aarch64`
- Show real file size on systems with ZFS compression enabled.
- performance: dua-cli full scan takes way longer than gdu HOT 7
- Performance is constrained by single-core CPU speed when I/O does not depend on CPU HOT 4
- error[E0446]: crate-private type `FilesystemScan` in public interface HOT 5
- Got a trojan threat from Windows defender when using dua HOT 4
- `dua a` will get the all the sizes of its content if the argv is one directory instead of the directory itself
- Cursor line not visible with NO_COLOR HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dua-cli.