Skip to content

Sync internal 2026-04-17#864

Merged
drcaramelsyrup merged 13 commits into
mainfrom
sync-internal-2026-04-10
Apr 18, 2026
Merged

Sync internal 2026-04-17#864
drcaramelsyrup merged 13 commits into
mainfrom
sync-internal-2026-04-10

Conversation

@drcaramelsyrup

Copy link
Copy Markdown
Collaborator

No description provided.

johnhurt and others added 13 commits March 30, 2026 09:47
Add BodyWriter task API (send_body_task, write_current_body_task,
send_finish_task, write_current_finish_task) and HeaderWriter for
cancel-safe writes that can be used in tokio::select! loops.
Using the proxy task API allows polling for the upstream rx task at the
same time, so that upstream cache writes can continue even while serving
downstream. proxy_h2 and h2 downstream (as well as custom) is a todo.
This was previously counting the response header bytes as well, which is
incorrect.
Add LruUnit::peek_lru(), Lru::peek_lru(shard), and Manager::peek_lru(shard)
to peek at the least-recently-used item in a shard without evicting it.
Returns None for empty shards or out-of-bounds shard indices.

This enables callers to report the eviction frontier — the age of the item
that would be evicted next — for cache observability metrics.
Update bench_lru to test at production-level data sizes (~100K and ~500K
items/shard). The original benchmark only tested 100 items across 10
shards (10 per shard), which made promote_top_n appear 42% faster. At
larger scales, promote() is actually 20-25% faster because the read-lock
scan rarely finds hot items near the head.

Add heavy-hitter benchmarks (10 and 100 items at 10,000x weight) to
test whether extremely concentrated access patterns benefit from
promote_top_n. Result: promote() still ties or wins even with heavy
hitters, because with few hot items spread across 32 shards, most
shards have 0-1 hot items and the scan is wasted on cold accesses.

Each benchmark variant uses a fresh LRU and a thread barrier to avoid
state contamination and staggered starts. The 16M-item config is gated
behind BENCH_LARGE=1 to avoid OOM on CI.

Add a performance warning to promote_top_n() docs recommending promote()
for large-scale workloads.
Also temp ignore the active RUSTSECs until the internal dependency bumps
are synced.
@drcaramelsyrup drcaramelsyrup merged commit c0adfd3 into main Apr 18, 2026
7 checks passed
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.

5 participants