Skip to content
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

Merged
merged 8 commits into from
Nov 8, 2018
Merged

raft: reduce memory allocation when reset #130

merged 8 commits into from
Nov 8, 2018

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Oct 3, 2018

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.

@Hoverbear
Copy link
Contributor

Looks like this depends on #119 ?

Hoverbear
Hoverbear previously approved these changes Nov 1, 2018
@Hoverbear
Copy link
Contributor

Merged and resolved conflicts for you :)

@Hoverbear
Copy link
Contributor

@overvenus PTAL

@siddontang
Copy link
Contributor

PTAL @hicqu

@hicqu
Copy link
Contributor

hicqu commented Nov 8, 2018

LGTM. 👍

hicqu
hicqu previously approved these changes Nov 8, 2018
overvenus
overvenus previously approved these changes Nov 8, 2018
Copy link
Member

@overvenus overvenus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@overvenus overvenus dismissed their stale review November 8, 2018 11:20

CI failing

@Hoverbear
Copy link
Contributor

I'll handle it! Thanks. :)

@Hoverbear Hoverbear dismissed stale reviews from hicqu and themself via 840c38e November 8, 2018 13:58
@siddontang
Copy link
Contributor

@Hoverbear please approves it

Copy link
Contributor

@Hoverbear Hoverbear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

bors bot added a commit that referenced this pull request Nov 8, 2018
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]>
@bors
Copy link
Contributor

bors bot commented Nov 8, 2018

@bors bors bot merged commit cded3d7 into master Nov 8, 2018
@overvenus overvenus deleted the opt-reset branch November 9, 2018 04:24
@Hoverbear Hoverbear added this to the 0.5.0 milestone Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants