-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
walk: fd -L
should include broken symlinks
#497
Conversation
Failing due to |
From a first glance, the code looks great. Thank you for your contribution! I would definitely like to see some benchmark results before merging this. I can do this on my own, but that might take some time. The https://github.com/sharkdp/fd-benchmarks repository has a |
I'm okay with bumping the minimum required Rust version. It needs to be changed in |
@sharkdp ran The high level summary is:
Which I would interpret as |
Thank you very much. The standard deviations are pretty high for some of your benchmark runs, around 15%. Are you sure that you were running the benchmarks on a "quiet" PC? No Dropbox, Spotify, etc. running in the background? To me, the deviations look like statistical noise. I also ran the benchmark suite on my PC and get the following result: No pattern
Simple pattern
Simple pattern (-HI)
File extension
File type
Cold cache
So it looks like there is no significant difference between the two versions, which is great! In fact, we recently added a script to the hyperfine repository that performs a statistical t-test to check whether or not two benchmark results follow the same distribution. Here are the results:
|
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 added a few in-line comments
@tommilligan There is no rush, but I'd like to know if you plan to finish this at some point. Otherwise, we could try to find someone else. |
fd2c012
to
193e3c2
Compare
This implementation does not really work. See BurntSushi/ripgrep#1503 for an upstream bug report. |
I wrote a completely new implementation, which fixes the outstanding unit test.
|
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
./fd-master --hidden --no-ignore '' '/home/shark' |
1.059 ± 0.046 | 1.007 | 1.120 | 1.03 ± 0.05 |
./fd-feature --hidden --no-ignore '' '/home/shark' |
1.023 ± 0.021 | 1.006 | 1.066 | 1.00 |
Simple pattern
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
./fd-master '.*[0-9]\.jpg$' '/home/shark' |
176.2 ± 4.8 | 169.8 | 185.7 | 1.02 ± 0.04 |
./fd-feature '.*[0-9]\.jpg$' '/home/shark' |
173.0 ± 4.9 | 167.3 | 187.4 | 1.00 |
Simple pattern (-HI)
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
./fd-master -HI '.*[0-9]\.jpg$' '/home/shark' |
501.7 ± 7.7 | 493.5 | 514.8 | 1.01 ± 0.02 |
./fd-feature -HI '.*[0-9]\.jpg$' '/home/shark' |
497.1 ± 5.5 | 489.1 | 506.9 | 1.00 |
File extension
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
./fd-master -HI --extension jpg '' '/home/shark' |
510.8 ± 6.2 | 506.3 | 526.8 | 1.00 |
./fd-feature -HI --extension jpg '' '/home/shark' |
511.1 ± 2.6 | 507.4 | 514.8 | 1.00 ± 0.01 |
File type
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
./fd-master -HI --type l '' '/home/shark' |
495.4 ± 12.5 | 484.8 | 525.4 | 1.00 |
./fd-feature -HI --type l '' '/home/shark' |
496.5 ± 4.4 | 490.0 | 502.5 | 1.00 ± 0.03 |
Cold cache
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
./fd-master -HI '.*[0-9]\.jpg$' '/home/shark' |
5.325 ± 0.025 | 5.297 | 5.340 | 1.01 ± 0.01 |
./fd-feature -HI '.*[0-9]\.jpg$' '/home/shark' |
5.283 ± 0.027 | 5.252 | 5.299 | 1.00 |
This can actually be used to search for broken symlinks: fd -L -tl |
9cca9a2
to
e31204b
Compare
This command returns working and non-working symlinks, and the only way to differentiate them is the color, which is hard to process using scripting. Is there a better way to find only broken links? |
@lestephane Not for me: tavianator@graphene $ touch file
tavianator@graphene $ ln -s file link
tavianator@graphene $ ln -s nowhere broken
tavianator@graphene $ fd -L -tl
broken
tavianator@graphene $ fd -tl
broken
link |
See also: #1298 |
There is a dead PR #366 already submitted for issue #357. I thought I would propose a smaller change that's more likely to be accepted into the codebase.
Happy to take feedback and change the design if needed in the interest of getting this closed!
Closes #357