cockroachdb / cockroachdb/cockroach
kvserver: turn CmdIDKey into []byte (from string) [0.4% 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
CmdIDKey is embedded into our raft commands, but if it's a string we can't have it point into an existing byte slice, which causes some allocations such as here in oltp_write_only:
It should be possible to change the type to `[]byte` without too much trouble, noting that by sharing the backing memory of an entry we'd need to be careful to copy the id slice if we wanted to stash it somewhere for longer periods of time.
Epic CRDB-55523
Jira issue: CRDB-45651
Contributor guide
Assessment
This issue has not been assessed yet.