cockroachdb / cockroachdb/cockroach

kvserver: reuse memory for roachpb.Key in latches and abort span (>1% allocs on oltp_write_only)

Open
#137,522 0 comments 0 reactions 0 assignees View on GitHub
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.

image
image

Epic CRDB-55523
Jira issue: CRDB-45640

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.