cockroachdb / cockroachdb/cockroach
rac2: investigate map optimizations
Open
A-replication-admission-control-v2
C-enhancement
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
RACv2 uses a bunch of small maps keyed by ReplicaID.
See the profile and discussion in https://cockroachlabs.slack.com/archives/C06UFBJ743F/p1731581849797989 where these map accesses were consuming 2.6% of CPU. These should already benefit from the following, so this will need some investigation:
> Go's builtin map has a fast-path for maps with int32, int64, and string keys that fit in a single bucket (8 entries) which avoids performing hash(key) and simply linearly searches through the bucket.
Jira issue: CRDB-44701
Contributor guide
Assessment
This issue has not been assessed yet.