Improve performance when using --long
#251
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the unix extended attributes are always read no matter what. This is maybe not ideal, as it is very expensive to call for files which we will not display and leads to significantly (~300x with level = 2) worse runtimes recursing large directories. This is fixed by only calling
unix::Attrs::from
when it is a file which is going to be displayed.This is my first PR here, so if I've missed anything please let me know.
Rough benchmarks
These are run with the path being my home directory, which consists of (per
erd
) 11650 directories, 124225 files, and 132 links. The command run istime erd -l --no-config -L 2 ~
for both cases, and all times are averaged over 5 runs.Before
After