cockroachdb / cockroachdb/cockroach
kvserver: reuse memory for roachpb.Key in latches and abort span (>1% allocs on oltp_write_only)
Open
branch-master
C-performance
o-perf-efficiency
T-kv
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
We allocate ad-hoc keys for abort spans and transaction related keys on hot paths. Many of them seem to share a lifetime with the `SpanSet` latches. There is already a pooling facility for span sets and I don't think we routinely leak these created keys elsewhere, so it's possible that we can avoid most of these allocations by creating these keys from a pool associated with span sets and returning them when the spanset is finished.
Epic CRDB-55523
Jira issue: CRDB-45640
Contributor guide
Assessment
This issue has not been assessed yet.