forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raft: avoid allocating supportMap for every LeadSupportUntil calculation
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
- Loading branch information
1 parent
0c7b590
commit a785188
Showing
3 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters