Cache store: slim the in-memory index (≈144 → ≈60-70 B per record) #866
Labels
No labels
amd
avatars
bug
builder
cannot-reproduce
crash
epic
feature
from-viewer
gl-removal
known-limitation
monitoring
parity
perf
platform
priority
critical
priority
high
priority
low
priority
medium
provenance
rendering
rt
status
in-progress
status
testing
status
up-next
triage
ui
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sky_line/Slipstream#866
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Follow-up to #715. The store's index is
std::unordered_map<Key, Entry>across 64 shards (llcachestore.cpp~278-302). With 1.22M records (956k of them mesh parts), that's about 144 B/record ≈ 170 MB RAM (measured with the same layout). The old caches held about 6 MB in RAM.The index also loads at startup, and that time grows with it: 7.8 ms at 33k records, 338 ms at 1.22M.
Where the bytes go
meta[32]inline on every entry, which only GPU-ready records use (27 B);PendingPtr(shared_ptr, 16 B), almost always null.Plan
metaout ofEntryinto a side table (per shard, keyed by slot), present only for kinds that write meta.pendinginto a small per-shard map of in-flight writes.statsLine()/ CacheMetrics, and measure snapshot load time against record count.No on-disk format change is needed for 1-3 (snapshot format may change; a snapshot mismatch already falls back to a scan).
Optional, larger: one index record per mesh with a part table instead of one per part (about 70% fewer records). That needs a mesh layout change and lazy rewrite like the per-level texture ticket.
Acceptance
Fixed in 1.4.1 (
8ed2c0c626). Reopen if you still see it.