Add small in-actor LRU cache for hot assets

AssetStoreServer runs on a single dedicated smarm actor thread, so a
plain HashMap+VecDeque LRU in front of the SQLite lookup needs no
locking. Capacity configurable via CCC_CACHE_CAPACITY (default 256).

Bench (bench/RPS): +42-47% RPS under a cache-sized/hot-set workload,
but a small net loss under adversarial uniform-random access with a
cache smaller than the catalog. Real traffic is hot-set skewed, so
net win in practice; capacity should be tuned to the expected hot set.
This commit is contained in:
2026-08-08 22:59:57 +02:00
parent cdedab3302
commit 24175dde36
5 changed files with 233 additions and 4 deletions
+4
View File
@@ -3,3 +3,7 @@
/staging/*
!/staging/.gitkeep
# bench harness generates these locally (see bench/RPS); not meant to be committed
bench/urls*.txt
bench/full_urls*.txt