Commit 06314be
committed
feat: add benchmark for displaying all programs in PATH
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
```1 parent 5738954 commit 06314be
1 file changed
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
0 commit comments