lsd icon indicating copy to clipboard operation
lsd copied to clipboard

Add no-windows-permissions feature, to disable access/owner checks

Open vvuk opened this issue 4 years ago • 4 comments

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

vvuk avatar Feb 09 '21 22:02 vvuk

Codecov Report

Merging #484 (7526910) into master (841ad99) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           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 data Powered by Codecov. Last update 841ad99...7526910. Read the comment docs.

codecov-io avatar Feb 09 '21 23:02 codecov-io

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?

meain avatar Feb 13 '21 04:02 meain

false works for me, done!

vvuk avatar Feb 13 '21 07:02 vvuk

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.

Aankhen avatar Oct 05 '21 11:10 Aankhen

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!

vvuk avatar Mar 08 '23 05:03 vvuk

I suggest closing this one since https://github.com/lsd-rs/lsd/pull/882 is merged (adding --permission disabled) 👍

domsleee avatar Sep 25 '23 11:09 domsleee