-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raft: reduce memory allocation when reset #130
Conversation
Looks like this depends on #119 ? |
Merged and resolved conflicts for you :) |
@overvenus PTAL |
PTAL @hicqu |
LGTM. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll handle it! Thanks. :) |
@Hoverbear please approves it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
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 <[email protected]> Co-authored-by: Hoverbear <[email protected]> Co-authored-by: qupeng <[email protected]>
Create a new progress will allocate a vec. So this pr adds a reset function to avoid the allocation. Little performance enhancement is detected: