-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
130: raft: reduce memory allocation when reset r=Hoverbear a=BusyJay Create a new progress will allocate a vec. So this pr adds a reset function to avoid the allocation. Little performance enhancement is detected: ``` Raft::campaign (7, 3, CampaignElection) time: [2.8076 us 2.8291 us 2.8565 us] change: [-4.6982% -4.2007% -3.6530%] (p = 0.00 < 0.05) Performance has improved. ``` Co-authored-by: Jay Lee <busyjaylee@gmail.com> Co-authored-by: Hoverbear <operator@hoverbear.org> Co-authored-by: qupeng <onlyqupeng@gmail.com>
- Loading branch information
Showing
6 changed files
with
61 additions
and
67 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
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