Repository navigation
find: look up whether each owner and group exists once for -nouser and -nogroup - #1043
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1043 +/- ##
==========================================
+ Coverage 92.29% 92.39% +0.09%
==========================================
Files 38 38
Lines 8714 8745 +31
Branches 429 427 -2
==========================================
+ Hits 8043 8080 +37
+ Misses 532 529 -3
+ Partials 139 136 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance1 warning
Comparing |
sylvestre
reviewed
Nov 24, 2026
| }) | ||
| } | ||
|
|
||
| fn exists( |
Contributor
There was a problem hiding this comment.
this is a second cache per id next to cached. could one map with Option<String> cover both, or is it not worth it?
Contributor
|
Thanks for your PR |
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.
-nouserand-nogrouplooked up the passwd or group entry of every file, which reads/etc/passwdor/etc/groupagain each time: on a 37,256-entry tree,-nouser -o -nogroupopened them 37,256 and 37,079 times.This remembers per id whether it has an entry, next to the name cache from #1033. A failed lookup still counts as no entry, as before, but is not remembered, so every file gets the answer the per-file lookup gave.
37,256 entries on tmpfs, hyperfine, 15 runs:
-nouser-nouser -o -nogroupOutput and exit codes match main for
-nouser,-nogroup,-nouser -o -nogroup,! -nouser,-nouser -nogroup,-nouser -ls,-nogroup -printfand-print0, on a tree with owners that have no entry,nobodyandnogroup. They match GNU 4.9 and 4.10 too, apart from-nouser -ls, where main already differs from GNU.With #1033, every per-file user and group lookup in find now goes through this cache, which finishes the last item of #430.
Closes #430