feat: add benchmark for displaying all programs in PATH#5
Open
vegerot wants to merge 1 commit intosharkdp:masterfrom
Open
feat: add benchmark for displaying all programs in PATH#5vegerot wants to merge 1 commit intosharkdp:masterfrom
vegerot wants to merge 1 commit intosharkdp:masterfrom
Conversation
1 task
Author
|
The commit description was measured on macOS. On my GNU+Linux machine it's closer to 7x slower $ ./warm-cache-exe-paths.sh
Benchmark 1: FIND_PROG='find -L' FIND_ARGS='-maxdepth 1 -executable -type f,l -printf %f\n' get_programs_in_path
Time (mean ± σ): 40.6 ms ± 0.5 ms [User: 20.5 ms, System: 24.7 ms]
Range (min … max): 39.4 ms … 42.1 ms 71 runs
Benchmark 2: FIND_PROG='fd .' FIND_ARGS='--hidden --max-depth=1 --type=executable --follow --format {/} ' get_programs_in_path
Time (mean ± σ): 281.2 ms ± 4.3 ms [User: 54.0 ms, System: 397.8 ms]
Range (min … max): 276.5 ms … 288.7 ms 10 runs
Summary
FIND_PROG='find -L' FIND_ARGS='-maxdepth 1 -executable -type f,l -printf %f\n' get_programs_in_path ran
6.93 ± 0.13 times faster than FIND_PROG='fd .' FIND_ARGS='--hidden --max-depth=1 --type=executable --follow --format {/} ' get_programs_in_path
Both fd and find found the same 3806 results |
Summary:
This is the first regression we've seen for `fd` vs. `find`.
```sh
$ PATH="/opt/homebrew/Cellar/findutils/4.10.0/libexec/gnubin/:$PATH" ./warm-cache-exe-paths.sh
Benchmark 1: FIND_PROG=find FIND_ARGS='-maxdepth 1 -executable -type f,l -printf %f\n' get_programs_in_path
Time (mean ± σ): 142.0 ms ± 6.0 ms [User: 32.7 ms, System: 72.0 ms]
Range (min … max): 129.7 ms … 154.6 ms 20 runs
Benchmark 2: FIND_PROG='fd .' FIND_ARGS='--hidden --max-depth=1 --type=executable --follow --format {/} ' get_programs_in_path
Time (mean ± σ): 272.1 ms ± 6.0 ms [User: 88.8 ms, System: 142.1 ms]
Range (min … max): 258.2 ms … 279.9 ms 10 runs
Summary
FIND_PROG=find FIND_ARGS='-maxdepth 1 -executable -type f,l -printf %f\n' get_programs_in_path ran
1.92 ± 0.09 times faster than FIND_PROG='fd .' FIND_ARGS='--hidden --max-depth=1 --type=executable --follow --format {/} ' get_programs_in_path
Both fd and find found the same 2943 results
```
|
See sharkdp/fd#1614 (comment) and below for some analysis. I don't think this benchmark is useful as-is, but it may be interesting to add benchmarks for wide, shallow directories as well as empty directories to measure startup overhead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
This is the first regression we've seen for
fdvs.find.