diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-28 00:48:18 -0600 |
|---|---|---|
| committer | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-28 00:48:18 -0600 |
| commit | 3abe682147f74104f1f1225e8c142b80018e17e7 (patch) | |
| tree | 1ef44f0ebbfd2bccd747c3557a46bc1842b97eb9 /scripts/git@git.abendless.com: | |
| parent | 270ac6676c05470223c5fc09fb3230b97acfbe2b (diff) | |
| download | zash-3abe682147f74104f1f1225e8c142b80018e17e7.tar.gz | |
perf(glob): do not lstat() a component readdir() just named
The last component of a pattern was matched by readdir() and then stat'ed
again by the recursive call, only to learn that the name it had just read
exists. When nothing follows the component, add it straight away; a
literal tail and a trailing `/` still go through lstat(), the second
because `*/` must not match a file.
Measured on Linux (x86-64) with 3000 names in one directory and
`set -- d/*` run 200 times: 0.20 s before, 0.05 s after, three runs each,
same result count.
make check unchanged (126 passed, 1 skipped, the known
linux/i-dscomplete failure on this machine).
Diffstat (limited to 'scripts/git@git.abendless.com:')
0 files changed, 0 insertions, 0 deletions
