Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micro-optimization: Use storage.Store.ImagesByDigest for digest references #1352

Open
mtrmac opened this issue Mar 3, 2023 · 0 comments
Open

Comments

@mtrmac
Copy link
Collaborator

mtrmac commented Mar 3, 2023

Runtime.lookupImageInDigestsAndRepoTags calls, in

allImages, err := r.ListImages(context.Background(), nil, nil)
, effectively storage.Store.Images, getting a copy of all images.

On the

if isDigested {
path, allImages is manually filtered to only those (the first one) that actually match that digest in storage.Image.Digests.

It seems to me that that code path could call storage.Store.ImagesByDigest, and the full allImages collection could only happen later, to implement the inRepoTags search.

That would save a bit of memory and CPU time when copying image objects from the c/storage primary records into a return value, and the like — OTOH it’s all on a “fallback heuristics” path, so it might well not be worth worrying about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant