Skip to content

perf(store): optimize UpdateReadSet allocation pattern#2852

Merged
pdrobnjak merged 2 commits intomainfrom
perf/optimize-updatereadset-alloc
Feb 11, 2026
Merged

perf(store): optimize UpdateReadSet allocation pattern#2852
pdrobnjak merged 2 commits intomainfrom
perf/optimize-updatereadset-alloc

Conversation

@pdrobnjak
Copy link
Contributor

@pdrobnjak pdrobnjak commented Feb 11, 2026

Summary

Optimize allocation pattern in UpdateReadSet to reduce GC pressure.

🤖 Generated with Claude Code

@github-actions
Copy link

github-actions bot commented Feb 11, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 11, 2026, 4:59 PM

Store value directly on first insert instead of creating an empty slice
then appending, saving one allocation per new readset key. In the common
case (new key read for the first time), this eliminates the intermediate
empty [][]byte{} allocation.

Before: readset[key] = [][]byte{} → append(readset[key], value) (2 allocs)
After:  readset[key] = [][]byte{value}                         (1 alloc)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.10%. Comparing base (55c0254) to head (c34db68).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2852       +/-   ##
===========================================
+ Coverage   48.31%   57.10%    +8.78%     
===========================================
  Files         671     2088     +1417     
  Lines       50574   171079   +120505     
===========================================
+ Hits        24437    97701    +73264     
- Misses      23998    64697    +40699     
- Partials     2139     8681     +6542     
Flag Coverage Δ
sei-chain 52.56% <66.66%> (?)
sei-cosmos 48.13% <100.00%> (+<0.01%) ⬆️
sei-db 68.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-cosmos/store/multiversion/mvkv.go 90.90% <100.00%> (+0.11%) ⬆️

... and 1540 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pdrobnjak pdrobnjak force-pushed the perf/optimize-updatereadset-alloc branch from de1b10e to 9581921 Compare February 11, 2026 13:34
@pdrobnjak pdrobnjak force-pushed the perf/lazy-init-sorted-cache branch from 6ac2e41 to 4a4adcb Compare February 11, 2026 13:34
@pdrobnjak pdrobnjak changed the base branch from perf/lazy-init-sorted-cache to main February 11, 2026 13:34
@pdrobnjak pdrobnjak self-assigned this Feb 11, 2026
@pdrobnjak pdrobnjak changed the title perf(store): optimize UpdateReadSet allocation pattern perf(store): optimize UpdateReadSet allocation pattern Feb 11, 2026
@pdrobnjak pdrobnjak requested a review from codchen February 11, 2026 15:12
@pdrobnjak pdrobnjak assigned arajasek and unassigned arajasek Feb 11, 2026
@pdrobnjak pdrobnjak requested a review from arajasek February 11, 2026 15:12
@pdrobnjak pdrobnjak enabled auto-merge (squash) February 11, 2026 16:58
@pdrobnjak pdrobnjak merged commit e31ab0c into main Feb 11, 2026
40 checks passed
@pdrobnjak pdrobnjak deleted the perf/optimize-updatereadset-alloc branch February 11, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments