Add no-windows-permissions feature, to disable access/owner checks
Doing this on Windows is very slow; this adds a feature flag to disable doing these checks, making lsd as fast as any other directory listing tool. Without this, running lsd on a directory with ~100 files takes around 600ms. With this feature enabled, it takes 40ms.
Adds a bunch of compilation warnings unfortunately; the structure could be better to clean this up.
TODO
- [ ] Use
cargo fmt - [ ] Add necessary tests
- [ ] Add changelog entry
Codecov Report
Merging #484 (7526910) into master (841ad99) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #484 +/- ##
=======================================
Coverage 84.45% 84.45%
=======================================
Files 36 36
Lines 3378 3378
=======================================
Hits 2853 2853
Misses 525 525
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 841ad99...7526910. Read the comment docs.
Having this behind a feature flag seems like a good compromise until we have a better solution, which I guess should be possible from https://github.com/Peltoche/lsd/pull/475#issuecomment-777101864
One thing that's kind of interesting is that dir /q can pull this info quite quickly. cmd /c dir /q takes about 50ms for my test dir from another PR (unpatched lsd takes about 600ms; patched to hack out permission/ownership, 40ms). That pays the same process creation cost (cmd.exe) as lsd would. Might be useful to systrace & profile cmd.exe and see what it's doing, as dir is an internal call there.
What do you think about having all the values as false instead of true?
false works for me, done!
I tried this locally combined with #473 (after fixing a tiny merge conflict) and it makes a huge difference. Running lsd in a particular directory consistently took about 8 seconds before. Now it takes 479 milliseconds.
and, @vvuk did you have some cycle to update this PR again, and we can make it happen after the discuss resolved?
I don't at the moment -- if you're able to take it over, please do!
I suggest closing this one since https://github.com/lsd-rs/lsd/pull/882 is merged (adding --permission disabled) 👍