Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
138374: raft: avoid allocating supportMap for every LeadSupportUntil calculation r=iskettaneh a=iskettaneh This adds supportExpMap that hangs off the fortificationTracker. This is useful to avoid allocating the map for every LeadSupportUntil calculation. This is now possible since all the calls to ComputeLeadSupportUntil are done with a lock held. Note that this doesn't seem to improve the performance of ComputeLeadSupportUntil when the number of voters are low. The reason is that there is a go compiler optimization that seems to make an on-stack map allocation if the size is small. References: cockroachdb#137264 Release note: None Co-authored-by: Ibrahim Kettaneh <[email protected]>
- Loading branch information