Skip to content

perf: account deserialization cache, access list pooling#2846

Draft
pdrobnjak wants to merge 4 commits intoperf/event-marking-vis-reuse-eventmgr-poolfrom
perf/account-deser-cache-accesslist-pool
Draft

perf: account deserialization cache, access list pooling#2846
pdrobnjak wants to merge 4 commits intoperf/event-marking-vis-reuse-eventmgr-poolfrom
perf/account-deser-cache-accesslist-pool

Conversation

@pdrobnjak
Copy link
Contributor

Summary

  • Add account deserialization cache and pool access list instances to reduce allocations

Stack

11/13 — depends on perf/event-marking-vis-reuse-eventmgr-pool

🤖 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, 1:38 PM

@pdrobnjak pdrobnjak self-assigned this Feb 11, 2026
@pdrobnjak pdrobnjak force-pushed the perf/account-deser-cache-accesslist-pool branch from 06e97ec to e06b8ed Compare February 11, 2026 13:19
pdrobnjak and others added 4 commits February 11, 2026 14:37
1. Remove redundant sort.Strings in SetWriteset/SetEstimatedWriteset
2. Replace 3 global RWMutex+maps with per-tx-index txSlot array
3. Replace select{} workers with for-range + defer close
4. Pool giga EVM executors via sync.Pool within a block

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Pool VersionIndexedStore via sync.Pool to avoid per-tx per-store
  map allocations (~10 GB reduction)
- Add CacheMultiStoreForOCC to build child CMS directly with VIS
  stores, bypassing intermediate storeParents copy (~16 GB reduction)
- Change ReadSet from map[string][][]byte to map[string]ReadSetEntry
  to eliminate per-key slice allocations (~4.5 GB reduction)
- Reuse versionStoresBuf map across task incarnations (~1 GB reduction)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…hot release

- MarkEventsToIndex: modify events in-place instead of copying (~4.5 GB)
- NewEvent: pre-allocate attributes slice to exact size
- EventManager: sync.Pool for reuse across EVM snapshots (~2-3 GB)
- VIS Reset: clear() maps instead of make() via clone-on-store (~4 GB)
  - SetReadset/SetIterateset clone data before storing in txSlot
  - Reset() reuses existing map/slice capacity
- RevertToSnapshot: release CMS stores and EventManagers from
  discarded contexts back to sync.Pools (~5-8 GB)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add per-context account cache to avoid repeated protobuf unmarshal in
hot paths like LockedCoins → GetAccount. Each WithMultiStore creates a
fresh cache so EVM snapshot/revert correctness is maintained. Eliminates
~4 deserializations per EVM tx for the sender address alone.

Pool EVM accessList structs via sync.Pool with pre-sized maps (24 addrs)
to avoid per-tx map allocation. Release on DBImpl.Cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pdrobnjak pdrobnjak force-pushed the perf/account-deser-cache-accesslist-pool branch from e06b8ed to cb598f8 Compare February 11, 2026 13:37
@pdrobnjak pdrobnjak force-pushed the perf/event-marking-vis-reuse-eventmgr-pool branch from 30b77de to ba228a5 Compare February 11, 2026 13:37
Comment on lines +422 to +424
parent = gs
} else if gp, ok := cms.gigaStoreParents[key]; ok {
parent = gp

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +425 to +429
} else if s, ok := cms.stores[key]; ok {
parent = s.(types.KVStore)
} else if p, ok := cms.storeParents[key]; ok {
parent = p.(types.KVStore)
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@pdrobnjak pdrobnjak marked this pull request as draft February 11, 2026 14:07
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.

1 participant