perf(cache): tune policy — pslr.cache escape hatch + 200k bound (P5, PSLR-ynbfnhkp)#61
Merged
Merged
Conversation
…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>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,nstays 0).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 check0/0/0;FAIL 0 | PASS 482; lint 0.🤖 Generated with Claude Code