Repository navigation
updatedb: improve perf and error message - #713
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #713 +/- ##
==========================================
- Coverage 92.01% 91.83% -0.18%
==========================================
Files 35 35
Lines 7097 7129 +32
Branches 374 375 +1
==========================================
+ Hits 6530 6547 +17
- Misses 423 437 +14
- Partials 144 145 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
sylvestre
force-pushed
the
fstype-reuse-cached-metadata
branch
from
June 8, 2026 21:19
29c8fd1 to
55fae46
Compare
Opening the output file with `?` surfaced a bare "No such file or directory" with no indication of which file failed (easy to hit because the default output path /usr/local/var/locatedb often doesn't exist). Report it like GNU does, naming the path and the reason, e.g. `cannot create '/usr/local/var/locatedb': No such file or directory`. strip_errno() drops the trailing "(os error N)" noise.
sylvestre
force-pushed
the
fstype-reuse-cached-metadata
branch
from
June 8, 2026 21:28
55fae46 to
7918945
Compare
sylvestre
marked this pull request as ready for review
June 8, 2026 21:32
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.