3 ms·
time find ~ -type f 6.99 user 10.66 system 53% cpu 33.218 total Second run: About the same (-0.32, -0.78, -1.929) time fd --type f 4.61 user 11.27 system 120%
by MayeulC 4y ago
time find ~ -type f
6.99 user 10.66 system 53% cpu 33.218 total
Second run: About the same (-0.32, -0.78, -1.929)
time fd --type f
4.61 user 11.27 system 120% cpu 13.172 total
Second run:
4.06 user 4.35 system 178% cpu 4.720 total
That's on an SSD. Admittedly, fd skips over hidden files and some directories by default. Adding them back (-u), it seems to take about the same time.
13.74 40.58 145% 37.324
Though it falls back to 13s if I disable colored output.
Piping these in wc -l to eliminate vt overhead, I have 1.4M matches, in about 5s for fd and 11s for find (warm runs, there is quite a bit of jitter). About 1s if I let fd skip hidden directories (.cache, .git, etc: 0.4M matches).
Point is, it's usually noticeably more responsive for realistic use-cases (and has colored output, parses .gitignore files, etc).