Skip to content

perf: improvements to the walker hot path - #623

Closed
bootandy wants to merge 5 commits into
masterfrom
perf
Closed

bootandy wants to merge 5 commits into
masterfrom
perf

Conversation

@bootandy

@bootandy bootandy commented Sep 9, 2026

Copy link
Copy Markdown
Owner

see: #575

arcuru and others added 5 commits September 9, 2026 23:13
Also thread metadata through the ignore_file -> build_node boundary so
filter-active walks (-x / -M / -A / -y) stat each entry at most once.

Correctness verified by diffing output against the pre-change binary
with default flags, -i, -e, -v, -X, -M, -x.

Assisted-by: Claude Opus 4.7 (code review, refactoring)
Assisted-by: Claude Opus 4.7 (code review, refactoring)
Under `-f` the file's stat is mostly thrown away — `node_from_tuple`
sets size to 1 and the time fields are only read when -M/-A/-y are
on. The only field still needed downstream is `inode_device` for
`clean_inodes` dedup, and both halves are syscall-free: `inode`
from `DirEntry::ino()` (getdents64), `dev` from the parent
directory's cached tuple.

Gated to `-f` without `-L` and without metadata-needing filters,
so output is byte-identical to the previous stat path. Unix-only;
Windows DirEntry has no cheap d_ino analogue.

Assisted-by: Claude Opus 4.7 (code review, refactoring)
Syscall reduction verified via strace on a 3-dir / 5-file test tree:
statx count drops from 11 to 8, exactly one per directory saved.

Assisted-by: Claude Opus 4.7 (code review, refactoring)
@bootandy bootandy closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants