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

lsd is slow Windows #200

Closed
lzybkr opened this issue May 21, 2019 · 20 comments · Fixed by #911
Closed

lsd is slow Windows #200

lzybkr opened this issue May 21, 2019 · 20 comments · Fixed by #911
Labels
help wanted Extra attention is needed kind/bug Something isn't working os/windows

Comments

@lzybkr
Copy link

lzybkr commented May 21, 2019

Performance is very slow - about 50 seconds to list a few files.

The long delay appears to be in calling lsd::meta::windows_utils::get_acl_access_mask.

Possibly relevant details - I'm testing on Win10 1903 on a domain joined machine. I suspect the issue is contacting the domain controller, because when I disconnect the machine from the network, lsd.exe gives me this error:

cannot access '.': The specified domain either does not exist or could not be contacted. (os error 1355)

I also tested on a non-domain joined machine (Server 2016) and it seemed plenty fast.

@lzybkr lzybkr added the kind/bug Something isn't working label May 21, 2019
@gchamon
Copy link

gchamon commented May 21, 2019

Is windows even supported?

@Peltoche
Copy link
Collaborator

Hi!

Is windows even supported?

Yep but it's in early stage for now. I will soon add some documentation into the README.

@gchamon
Copy link

gchamon commented May 21, 2019

Cool, because I was surprised to see Windows issues when I couldn't find anything in the readme. Nice! I will also try it in my secondary windows machine

@Berrysoft
Copy link

Berrysoft commented Jun 3, 2019

I tried in Windows and it is as fast as in WSL, sometimes faster. But I do sometimes come across the error cannot access '.' if -a is passed. This error also sometimes happen in WSL when accessing files in Windows.

@pplmx
Copy link

pplmx commented Jan 28, 2021

very very very slow in win 10, listing a directory with four sub-folders will cost one minute or more.
In WSL, its speed is normal.

@banjo
Copy link

banjo commented Apr 21, 2021

Any news on this? The same directory works great in WSL but takes over 20s on Git Bash for me.

@santagada
Copy link

I've ran a profiler at it and the problem is all the calls to GetEffectiveRightsForAclW:

image

@ixzh
Copy link

ixzh commented Jan 24, 2022

generally 1/10 speed of ls

@zwpaper
Copy link
Member

zwpaper commented Mar 2, 2023

#817 (comment)

This program has a severe performance problem on windows when the number of files to read is large (30+), it blocks almost 100ms untill it starts to render with Core::display, I dug on the issue and its located on the Win32 call to GetEffectiveRightsFromAclW, I don't know why is so expensive.

Proposed solutions:

  1. Figure out why that function call is so expensive (maybe we can't solve it)
  2. Be more inaccurate on windows about the permissions of the user and group (since its not very relevant on windows systems), for example the libcxx of llvm obtains the permissions of a file assuming its read only and then just checking if the property FILE_ATTRIBUTE_READONLY is set or not, assume that everything is executable and similar "inaccurate stuff"
  3. Change the creation of the Meta struct to only retrieve the owner/group permissions if its really needed to display

Hope this helps

@cdecompilador please discuss the performance issue on windows here

@zwpaper zwpaper added the help wanted Extra attention is needed label Mar 2, 2023
@zwpaper
Copy link
Member

zwpaper commented Mar 2, 2023

#484 has some works in progress

@zwpaper zwpaper pinned this issue Mar 2, 2023
@ArnaudKunzi
Copy link

I don't know Rust, but is there anything i can do to help #484 go forward? It seems that the (last?) hang up is regarding the PR code coverage?

@zwpaper
Copy link
Member

zwpaper commented Mar 8, 2023

hi @ArnaudKunzi, it seems there is not only the coverage, some discussions need to be resolved, and added some of mine just now, let's try to make it happen in the near future.

@ArnaudKunzi
Copy link

ArnaudKunzi commented Mar 24, 2023

Would that help if I tried to fork @vvuk's PR #484 and resubmit it with the requested changes?
He doesn't seem to have much time at the moment.
Not sure to get it right on the first try but it seems rather straightforward. I just don't want to cause unnecessary confusion/duplication and waste the maintainers time.

@marcotrosi
Copy link

Any progress on this issue?

@ArnaudKunzi
Copy link

The PR needs to be rebased to the latest main branch version but I don't have sufficient knowledge to solve all conflicts and accommodate the other changes that happened since, so unless someone else fixes it, this is it.

@marcotrosi
Copy link

The PR needs to be rebased to the latest main branch version but I don't have sufficient knowledge to solve all conflicts and accommodate the other changes that happened since, so unless someone else fixes it, this is it.

have you asked for help/support from the other contributors?

@ShrykeWindgrace
Copy link

Even the latest lsd-1.0.0 the slowness is there:

PS> .\lsd.exe --version
lsd 1.0.0
PS> (Measure-Command { & .\lsd.exe }).TotalSeconds
14,4527767
PS> .\lsd.exe
 autocomplete   LICENSE   lsd.1   lsd.exe   README.md

@zwpaper
Copy link
Member

zwpaper commented Aug 28, 2023

as v1.0.0 is finally released, I will spend some time on this, We may improve this step by step, but I can not guarantee any time schedule...

it's welcome for any PR improvement to be sent!

@zwpaper
Copy link
Member

zwpaper commented Aug 28, 2023

I have a look at #484, and it is not difficult to implement as an option, so I did a POC

Any comment is welcome, and we could do it in this way if it works for people who meet this problem.

@bingoct
Copy link

bingoct commented Feb 4, 2024

in my test.
version: lsd 1.0.0 eza v0.18.0

===
on wsl2

time (lsd -alih --icon=always -R)

real    0m5.525s
user    0m1.701s
sys     0m1.268s

time (Downloads/eza -alih --icons=always -R)

real    0m12.055s
user    0m5.418s
sys     0m13.722s

===
on windows

Measure-Command { lsd -alih --icon=always -R }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 2
Milliseconds      : 996
Ticks             : 29965805
TotalDays         : 3.46826446759259E-05
TotalHours        : 0.000832383472222222
TotalMinutes      : 0.0499430083333333
TotalSeconds      : 2.9965805
TotalMilliseconds : 2996.5805

Measure-Command { eza -alih --icons=always -R }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 487
Ticks             : 4878319
TotalDays         : 5.6462025462963E-06
TotalHours        : 0.000135508861111111
TotalMinutes      : 0.00813053166666667
TotalSeconds      : 0.4878319
TotalMilliseconds : 487.8319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed kind/bug Something isn't working os/windows
Projects
None yet