You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(datastore): cost the stored-schema cache by estimated byte size
The stored-schema cache previously admitted every entry at a fixed cost of 1, so a
MaxCost configured in bytes (e.g. the server's 32MiB default, or the embedded
SchemaCacheMaxCostBytes) actually bounded the number of cached schema versions rather
than memory.
Cost each entry by ReadOnlyStoredSchema.EstimatedSize() instead: a rough schema byte
size plus, for each registered schema-derived cache kind, an estimate of the bytes it
adds once populated. Datastore readers pass the exact serialized size they just read;
other callers fall back to a cheap schema-text proxy, avoiding a full proto walk
(proto.Size is ~1.5ms on a 1k-definition schema). RegisterDerivedCache now takes a size
estimator, and the compiled-caveat cache estimates per-caveat CEL overhead.
0 commit comments