-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
fix: -f work with -T option output empty #1200
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, we don't allow merge commits in PRs, instead try dropping the merge commit and then git pull --rebase origin main
in the branch to rebase update instead (or pick rebase from the ui)
0e9f435
to
1b3ca94
Compare
Have Done! :) |
1b3ca94
to
63e925a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be about 18% slower when testing -l --tree
with hyperfine against latest main branch, I haven't had time to look at why yet
The changes introduces a call to the files path checking if it's a directory, however we store this in the File struct to avoid having to check more than once. Using `.path.is_dir()` lead to an 18% runtime increase on `--tree`, using `.is_directory`() doesn't regress performance, testing on my very noisy syste, it does even lead to a *slight* performance increase. Signed-off-by: Christina Sørensen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a performance fix, it would recheck whether the files path was a directory, which isn't nescesarry since that is stored in File anyways.
Can I get a +1 review on this to be sure it's correct/performant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good!
@cafkafk Thank you so much for pointing out my mistakes and offering suggestions for improvement. :) The performance test results on my local machine are as follows. This seems to be about 16% slower when testing -l --tree with hyperfine against v0.20.4, after perf Thanks again for your guidance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Especially in nested cases, like when printing our src/
in this repo, this produces a misaligned "tree" with orphan edges. Thinking about it a little more I'm also not too sure we really want -T
to work with -f
since a file tree only makes sense when there are directories. So to address the linked issue simply making both these options mutually exclusive might be saner solution.
closes: #1180