feat(PackageCacheFile): add a in-memory expiry map#42531
Open
Thooms wants to merge 1 commit intorenovatebot:mainfrom
Open
feat(PackageCacheFile): add a in-memory expiry map#42531Thooms wants to merge 1 commit intorenovatebot:mainfrom
Thooms wants to merge 1 commit intorenovatebot:mainfrom
Conversation
This allows for faster expiry lookup, which makes for the bulk of the loop on destroy(). Note that this doesn't remove the overhead of looping through all entries, but at least doesn't load the data from disk with a deserialization.
7373434 to
48bf91b
Compare
Collaborator
|
Hey, will be able to review the PR in couple hours |
zharinov
reviewed
Apr 10, 2026
Collaborator
zharinov
left a comment
There was a problem hiding this comment.
I don't agree with general direction of how this should be fixed. Stay tuned, I'm working on the PR which should help solve your problem using another approach.
7 tasks
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.
Changes
This PR introduces a small in-memory map that stores expiry times for keys in the
PackageCacheFileimplementation.We noticed in our deployment that it was starting to bottleneck on a non-small amount of repositories.
This allows for faster expiry lookup, which makes for the bulk of the loop on destroy(). Note that this doesn't remove the overhead of looping through all entries, but at least doesn't load the data from disk with a deserialization.
Result of the provided benchmark:
Context
Please select one of the following:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
Tested also on an internal repository with indeed a ~50% speedup on cache cleanup.