Skip to content

perf(cache): tune policy — pslr.cache escape hatch + 200k bound (P5, PSLR-ynbfnhkp)#61

Merged
bart-turczynski merged 1 commit into
mainfrom
feature/pslr-p5-cache-policy
Jul 2, 2026
Merged

perf(cache): tune policy — pslr.cache escape hatch + 200k bound (P5, PSLR-ynbfnhkp)#61
bart-turczynski merged 1 commit into
mainfrom
feature/pslr-p5-cache-policy

Conversation

@bart-turczynski

Copy link
Copy Markdown
Owner

P5 (final) of the columnar hot-path epic (PSLR-bzqvsatk). Cache policy decided on fresh post-P4 numbers.

Numbers: cold 98.8k/s, warm 133k/s, dupheavy 2.27M/s, scalar 8.9k/s. Cache-off is ~1.5× faster on one-shot unique batches (a call's own unique() already dedups) but ~1.9× slower on cross-call reuse → cache stays on by default.

Shipped:

  • options(pslr.cache = FALSE) — session escape hatch; byte-identical results (misses derived by the same path), only storage/reads toggle. Test added (off==on, n stays 0).
  • Default bound 50k→200k — columnar entries ~80B (~16MB full); a 200k-unique re-query drops 1.63s→0.83s (true hit vs flush-and-rederive). Full-flush eviction unchanged.

PRD s8.2 intact. Oracle byte-identical (RDS not regenerated). R CMD check 0/0/0; FAIL 0 | PASS 482; lint 0.

🤖 Generated with Claude Code

…00k (PSLR-ynbfnhkp)

P5 (final) of the columnar hot-path epic (PSLR-bzqvsatk). Decides the cache
policy with fresh post-P4 numbers.

Measured (source/load_all): cold 98.8k/s, warm 133k/s, dupheavy 2.27M/s,
scalar 8.9k/s. Cache-DISABLED is ~1.5x faster on one-shot unique batches (a
call's own unique() already dedups, so the mget read is pure overhead) but
~1.9x SLOWER on cross-call reuse (repeat-batch 150k vs 286k/s) -> cache stays
on by default.

Shipped:
- options(pslr.cache = FALSE): skips every cache read/write for the session.
  Byte-identical results (misses derived by the same path); only storage/reads
  toggle. For one-shot mostly-unique batches. Test added (off == on, n stays 0).
- Default cache bound 50,000 -> 200,000. Columnar entries ~80B (~16MB full);
  memory scales with live entries so small sessions pay nothing. A 200k-unique
  re-query drops from ~1.63s (flush + re-derive) to ~0.83s (true hit). Full-
  flush eviction semantics above the bound unchanged.
- Rejected threshold-skip-write (>cap store is already skipped; the cost is the
  read, which the escape hatch covers).

PRD s8.2 semantics intact. P1 oracle byte-identical (RDS not regenerated);
cache + list-activation suites green. R CMD check 0/0/0; devtools::test()
FAIL 0 / PASS 482; lint 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bart-turczynski bart-turczynski merged commit 6f82943 into main Jul 2, 2026
@bart-turczynski bart-turczynski deleted the feature/pslr-p5-cache-policy branch July 2, 2026 19:17
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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