Skip to content

Api cache optimizations - #42

Draft
fernandodeluret wants to merge 2 commits into
mainfrom
fdeluret/acc-375-api-cache-optimizations
Draft

fernandodeluret wants to merge 2 commits into
mainfrom
fdeluret/acc-375-api-cache-optimizations

Conversation

@fernandodeluret

@fernandodeluret fernandodeluret commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Changes:

  • GPA cache entries no longer pin ~64 KB streaming TCP chunks. Fresh accounts are copied into tight per-account allocations so resident memory matches accounted cache size. We pay an small copy cost on new accounts going into the cache (for the ones already there no added cost) and get in reward more memory efficient cache size (because we don't keep unnecesarily big 64kb chunks alive).

  • Cache insert (finalize_query) runs on the blocking pool instead of the request task. The client is no longer waiting on map build, write lock, or eviction.

  • The cache write lock no longer deallocates. Replaced and evicted entries are dropped after the lock is released.

  • Queries under min_bytes_per_query are rejected with a cheap size check and never enter the insert path.

  • Finalize jobs skip a query if a newer slot is already cached, and expose inflight / skipped metrics for that path.

…locked time not do any deallocation, optimize path for small not cached requests
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

Successfully merging this pull request may close these issues.

2 participants