perf(cache): columnar session cache — kill psl_result_field vapply x6 (P3, PSLR-ffdsymhk)#59
Merged
Merged
Conversation
…(PSLR-ffdsymhk) P3 of the columnar hot-path epic (PSLR-bzqvsatk). The session cache stored one R list per host and reassembled a data.frame via psl_result_field()'s vapply x6 on every call (hit or miss) — 1.2M closures/query at 200k hosts, why warm barely beat cold. - R/cache.R: cache value shape is now a key->integer-index env plus parallel column vectors (public_suffix, registrable_domain, rule, kind, rule_section, ps_depth, and the P2 byte offsets ps_start/rd_start). Doubling growth (length<- preserves + NA-pads); psl_cache_clear() resets the index env and every column atomically (PRD s7.4); capacity full-flush semantics unchanged (bound 50000L, batch > capacity matched-but-not-cached). - R/matcher.R: psl_resolve_cores() resolves hits via one mget of indices + vectorized column subsetting (no per-host closures), derives misses, appends them, and match()es back to per-input; returns a plain list of columns. psl_result_field() deleted. Offsets returned for P4. PRD s8.2 key semantics unchanged (key = list-identity|section|host; unknown/ output post-cache). P1 oracle byte-identical; cache + list-activation suites green. R CMD check 0/0/0; devtools::test() FAIL 0 / PASS 477; lint 0. Warm-path bench 3.29s -> 1.69s, cold 4.26s -> 2.12s (200k hosts). NEWS: Internal bullet added under the existing dev section. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 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.
P3 of the columnar hot-path epic (PSLR-bzqvsatk). Internal-only; oracle byte-identical.
The cache stored one R list per host and rebuilt a data.frame via
psl_result_field()'svapply×6 on every call — 1.2M closures/query at 200k hosts, why warm barely beat cold.ps_start/rd_start). Doubling growth;psl_cache_clear()resets index env + all columns atomically (s7.4); capacity full-flush semantics unchanged.mgetof indices + vectorized subsetting (no per-host closures);psl_result_field()deleted; offsets returned for P4.PRD s8.2 key semantics unchanged. Oracle + cache + list-activation suites green.
R CMD check0/0/0;FAIL 0 | PASS 477; lint 0. Warm bench 3.29s→1.69s, cold 4.26s→2.12s.🤖 Generated with Claude Code