-
-
Notifications
You must be signed in to change notification settings - Fork 437
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 very slow compared to ls when listing large directories #378
Comments
+1 to this. I did it on my 13GB home directory (macOS, so many small files in ~/Library). |
Yes. Automatically ls when changing directorycd() { lsd comes up with Compare with...
|
Same here. The time of listing 287188 files:
Whyt |
there is a PR for speed up, but not yet finished. #441. |
Since #441 was closed, is there any indication whether this issue will be fixed? |
Here is how $ hyperfine ls exa lsd
Benchmark 1: ls
Time (mean ± σ): 16.6 ms ± 1.9 ms [User: 12.4 ms, System: 4.1 ms]
Range (min … max): 13.1 ms … 20.3 ms 144 runs
Benchmark 2: exa
Time (mean ± σ): 47.9 ms ± 5.7 ms [User: 22.5 ms, System: 25.0 ms]
Range (min … max): 38.8 ms … 61.5 ms 57 runs
Benchmark 3: lsd
Time (mean ± σ): 7.213 s ± 0.310 s [User: 0.897 s, System: 1.699 s]
Range (min … max): 7.043 s … 8.060 s 10 runs
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
Summary
'ls' ran
2.89 ± 0.47 times faster than 'exa'
434.83 ± 52.45 times faster than 'lsd' So plain-old $ ls --version
ls (GNU coreutils) 9.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie.
$ lsd --version
lsd 0.23.1
$ exa --version
exa - list files on the command-line
v0.10.1 [+git]
https://the.exa.website/ |
Use
|
You can compare the number of particular system calls with these commands.
|
This is how I looked into the issue of lsd's bad performance. I created a directory in /tmp with 10,000 empty files. On my Linux system, /tmp is a tmpfs, and bash was the shell I used.
Then I compared the execution time of The options used were intended to disable features that differ between programs (such as icons and colors) but still display "long" output.
Next I logged the system calls made by each program.
You can see that lsd had many more system calls than the others. It's strace output was about 176M, so keep that in mind if you test on a directory with more files. Here's a count of how many times each system call was made for each program.
I used a spreadsheet to put the strace results in a table for easier comparison.
Here are some of the calls that stood out to me.
tl;dr: WTH?! |
as a workaround for now i turned off |
The |
It was enabled in my config file, I probably turned it on at some point, but it seems pretty much mandatory to have it disabled. Like I said the difference was massive, even if it doesn't address the overall slowness. |
I added Commands:
Output:
|
I just set
|
No. In my example there were two calls of |
ahhhhh. missed that (obviously).. Sorry! |
Any updates on this? Yes it is very very slow to the point of being unusable. Please fix, it's not that difficult. I can share my code for a custom tree command that prints in real-time and executes in less than 1 second. |
this should be fixed by v1.1.5, at least for first step: bash-5.1$ lsd --version
lsd 1.1.5
bash-5.1$ printf '\n\nlsd' ; time LC_ALL=C lsd --color=never --sort=none -1 --icon=never --ignore-config > /dev/null
lsd
real 0m1.925s
user 0m0.328s
sys 0m1.588s I'd like to close this issue to mark this update, in case of misleading to the slow performance. feel free to create a new issue if any other performance issues are met. I will keep improving the performance on lsd. |
Listing the Void Linux repo srcpkgs directory (about 12055 directories) takes far longer with lsd than it does with GNU ls.
lsd --color never 1.39s user 0.12s system 99% cpu 1.521 total
lsd 1.42s user 0.12s system 98% cpu 1.559 total
ls 0.01s user 0.02s system 91% cpu 0.034 total
The text was updated successfully, but these errors were encountered: