Skip to content

Commit 61ebd9b

Browse files
committed
Update benchmark results
1 parent e3b4020 commit 61ebd9b

File tree

1 file changed

+23
-39
lines changed

1 file changed

+23
-39
lines changed

README.md

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -331,61 +331,45 @@ Options:
331331

332332
## Benchmark
333333

334-
Let's search my home folder for files that end in `[0-9].jpg`. It contains ~190.000
335-
subdirectories and about a million files. For averaging and statistical analysis, I'm using
334+
Let's search my home folder for files that end in `[0-9].jpg`. It contains ~750.000
335+
subdirectories and about a 4 million files. For averaging and statistical analysis, I'm using
336336
[hyperfine](https://github.com/sharkdp/hyperfine). The following benchmarks are performed
337337
with a "warm"/pre-filled disk-cache (results for a "cold" disk-cache show the same trends).
338338

339339
Let's start with `find`:
340340
```
341-
Benchmark #1: find ~ -iregex '.*[0-9]\.jpg$'
342-
343-
Time (mean ± σ): 7.236 s ± 0.090 s
344-
345-
Range (min … max): 7.133 s … 7.385 s
341+
Benchmark 1: find ~ -iregex '.*[0-9]\.jpg$'
342+
Time (mean ± σ): 19.922 s ± 0.109 s
343+
Range (min … max): 19.765 s … 20.065 s
346344
```
347345

348346
`find` is much faster if it does not need to perform a regular-expression search:
349347
```
350-
Benchmark #2: find ~ -iname '*[0-9].jpg'
351-
352-
Time (mean ± σ): 3.914 s ± 0.027 s
353-
354-
Range (min … max): 3.876 s … 3.964 s
348+
Benchmark 2: find ~ -iname '*[0-9].jpg'
349+
Time (mean ± σ): 11.226 s ± 0.104 s
350+
Range (min … max): 11.119 s … 11.466 s
355351
```
356352

357-
Now let's try the same for `fd`. Note that `fd` *always* performs a regular expression
358-
search. The options `--hidden` and `--no-ignore` are needed for a fair comparison,
359-
otherwise `fd` does not have to traverse hidden folders and ignored paths (see below):
353+
Now let's try the same for `fd`. Note that `fd` performs a regular expression
354+
search by defautl. The options `-u`/`--unrestricted` option is needed here for
355+
a fair comparison. Otherwise `fd` does not have to traverse hidden folders and
356+
ignored paths (see below):
360357
```
361-
Benchmark #3: fd -HI '.*[0-9]\.jpg$' ~
362-
363-
Time (mean ± σ): 811.6 ms ± 26.9 ms
364-
365-
Range (min … max): 786.0 ms … 870.7 ms
366-
```
367-
For this particular example, `fd` is approximately nine times faster than `find -iregex`
368-
and about five times faster than `find -iname`. By the way, both tools found the exact
369-
same 20880 files :smile:.
370-
371-
Finally, let's run `fd` without `--hidden` and `--no-ignore` (this can lead to different
372-
search results, of course). If *fd* does not have to traverse the hidden and git-ignored
373-
folders, it is almost an order of magnitude faster:
374-
```
375-
Benchmark #4: fd '[0-9]\.jpg$' ~
376-
377-
Time (mean ± σ): 123.7 ms ± 6.0 ms
378-
379-
Range (min … max): 118.8 ms … 140.0 ms
358+
Benchmark 3: fd -u '[0-9]\.jpg$' ~
359+
Time (mean ± σ): 854.8 ms ± 10.0 ms
360+
Range (min … max): 839.2 ms … 868.9 ms
380361
```
362+
For this particular example, `fd` is approximately **23 times faster** than `find -iregex`
363+
and about **13 times faster** than `find -iname`. By the way, both tools found the exact
364+
same 546 files :smile:.
381365

382-
**Note**: This is *one particular* benchmark on *one particular* machine. While I have
383-
performed quite a lot of different tests (and found consistent results), things might
384-
be different for you! I encourage everyone to try it out on their own. See
366+
**Note**: This is *one particular* benchmark on *one particular* machine. While we have
367+
performed a lot of different tests (and found consistent results), things might
368+
be different for you! We encourage everyone to try it out on their own. See
385369
[this repository](https://github.com/sharkdp/fd-benchmarks) for all necessary scripts.
386370

387-
Concerning *fd*'s speed, the main credit goes to the `regex` and `ignore` crates that are also used
388-
in [ripgrep](https://github.com/BurntSushi/ripgrep) (check it out!).
371+
Concerning *fd*'s speed, a lot of credit goes to the `regex` and `ignore` crates that are
372+
also used in [ripgrep](https://github.com/BurntSushi/ripgrep) (check it out!).
389373

390374
## Troubleshooting
391375

0 commit comments

Comments
 (0)