perf(store): reduce scoped-list allocations and skip unused artifact clones - #2338
Merged
Conversation
Refs #2337. Add real Store facade controls before choosing allocation changes. Co-authored-by: Codex <codex@vectorcontrol.tech>
Refs #2337. Preserve insertion order, single-pass predicates, non-nil empty results and detached artifact metadata. Measure dense/all controls alongside sparse wins. Co-authored-by: Codex <codex@vectorcontrol.tech>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Closes #2337.
Measured result and limits
At 1,000 resident rows, ten-run results allocate 1,792 B instead of about 172 KB. Ten-artifact results allocate 1,888 B / 11 allocations instead of 179,072 B / 1,001 allocations; missing artifact queries have zero allocations instead of 1,001. Dense/all result allocation is unchanged.
This is not a universal latency claim: after an initial +12.4% unfiltered-run timing, interleaved before/after controls showed overlapping ranges and +2.7%/+5.4% dense/all medians at 1,000 rows. The allocation improvement is retained with this explicit tradeoff; no production request distribution, RSS, retained heap or end-to-end throughput was measured.
Validation
Passed on delivery files:
CGO_ENABLED=1 go test -race -p 2 ./internal/store -count=1 -cpu=4 -timeout=10m.CGO_ENABLED=0 go test -p 2 ./internal/store -count=1 -cpu=4 -timeout=10m,go vet -p 2 ./internal/store,staticcheck ./internal/store(2026.1).git diff --check.All seven required checks passed for
5ab5fca23881e77031d093ea9bff5a35cc1202ec:validate,go-edge,go-hub,windows-go,windows-frontend,backend-required,frontend-required(CI run). The backend integration and fixture E2E lanes passed; frontend/native/real-E2E lanes were path-filtered or dispatch-only and skipped as reported by CI. CodeRabbit explicitly skipped review and is not counted as code review. L3 real-login/model and L4 packaged/release validation are not claimed.Scope / hygiene
No API/schema/SQL/pool/index/debounce/runtime configuration change, new CI gate or production data. Existing architecture docs remain correct. Temporary comparison implementations were archived on the issue and removed from the worktree; only the benchmark, production helper and meaningful regressions remain. No runtime synchronization, rebuild, restart or deployment is included.