cockroachdb / cockroachdb/cockroach

rac2: investigate map optimizations

Open
#135,762 0 comments 0 reactions 0 assignees View on GitHub
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

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.