Cache.metaCache is dead: every cache hit does open+stat+ReadFile+JSON parse instead of the in-memory lookup README promises #70
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Verified against
mainat61f42e6.Cache.metaCache map[VariantKey]variantMetais declared atinternal/imgcache/cache.go:47and initialised at:73. It is never read and never written — grep returns exactly those two lines. ThevariantMetatype (cache.go:32-36) is dead with it.Consequently every cache hit goes to the filesystem:
os.Open+Stat+os.ReadFileof the.metasidecar +json.Unmarshal(internal/imgcache/storage.go:442-474).README.md:49claims "In-process caching of request-to-output mappings targets 1-5k r/s". That mechanism is this field, and it does not exist. Four syscalls and a JSON parse per hit is the difference between hitting that target and not.Definition of done
Either implement or delete — do not leave a third initialised-but-unused field.
If implementing (recommended):
~/.claude/GO_PACKAGE_DEFAULTS.mdand record the decision).sync.Map. The suite runs with-raceas of #55 and must stay clean.If deleting: remove the field, the
variantMetatype, and correctREADME.md:49so it no longer claims a mechanism that does not exist.Coordination
internal/imgcache/cache.gois heavily changed by PR #55. Do this after #55 merges, and treat point 4 as blocking — the eviction path and this cache must agree.