mirror of
https://github.com/uutils/findutils.git
synced 2026-06-10 15:48:30 -07:00
1be5541c746e4c18376fd61aad8da1082b8b5721
The -fstype matcher called path.symlink_metadata() (a statx/lstat syscall) on every entry before consulting its cache, just to obtain the device id. With several -fstype clauses on the same expression (as updatedb builds: nfs/NFS/proc), every file was stat'd once per clause. Derive the device id from WalkEntry::metadata() instead, which is cached on the entry in a OnceCell and shared across all matchers, so each file is stat'd at most once regardless of how many -fstype clauses run. On 'updatedb --localpaths=/usr' (~506k files) this drops statx calls from ~1.52M to ~506k and wall-clock from ~1.82s to ~1.32s, with byte-identical output.
findutils
Rust implementation of GNU findutils: xargs, find, locate and updatedb.
The goal is to be a full drop-in replacement of the original commands.
Run the GNU testsuite on rust/findutils:
bash util/build-gnu.sh
# To run a specific test:
bash util/build-gnu.sh tests/misc/help-version.sh
Comparing with GNU
Build/run with BFS
bfs is a variant of the UNIX find command that operates breadth-first rather than depth-first.
bash util/build-bfs.sh
# To run a specific test:
bash util/build-bfs.sh posix/basic
For more details, see https://github.com/uutils/findutils-tracking/
Description
Languages
Rust
98.7%
Shell
1%
Python
0.3%