Repository navigation
fix: use pointer receiver for FileResolver to enable reuse - #5483
Merged
willmurphyscode merged 1 commit intoNov 13, 2026
Merged
Conversation
Signed-off-by: Caleb Allen <caleb.allen@upwind.io>
Contributor
|
Thanks @caleballen ! I looks like I have let the CI run expire, so I'll just close and open real quick to get a fresh run. |
willmurphyscode
approved these changes
Nov 13, 2026
willmurphyscode
left a comment
Contributor
There was a problem hiding this comment.
Thanks! Nice catch.
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.
Description
Use a pointer receiver for FileResolver. This was identified as a bug which led to reallocation and decrease in performance.
The speedup is for library users who call FileResolver more than once on the same file source: before this change, each call rebuilt the whole file index; now the index is built once and reused, so N calls cost the same as one (CLI scans call it once and are unchanged).
The benchmark calls FileResolver 1 or 5 times on a fresh fileSource per iteration, built from tar archives of 100, 1,000 and 10,000 files and from a single file; source setup is not timed (Apple M3 Pro, Go 1.27.3, -count 10, compared with benchstat).
Type of change
Checklist
Issue references