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

Reduce allocs in AddPeer #81

Merged
merged 2 commits into from May 12, 2020
Merged

Conversation

aarshkshah1992
Copy link
Contributor

table.go Outdated
rt.PeerAdded(p)
return true, nil
}
pid := bucket.selectFirst(func(pi *PeerInfo) bool {
Copy link
Member

Choose a reason for hiding this comment

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

ot nit: shouldn't we pick the least useful peer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Stebalien What's the meaning of "ot nit" ?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, "off topic nit". That is, a small suggestion that isn't even related to the current patch (just something I noticed while reviewing it).

(I'm basically saying "feel free to ignore this for now, but we should fix this in a future patch").

@aarshkshah1992
Copy link
Contributor Author

aarshkshah1992 commented May 11, 2020

@Stebalien While I'm not really sure how much of an impact it will have, I've changed the code to use the least useful peer as it sounds like the right thing to do. Please take a look when you can !

@aarshkshah1992 aarshkshah1992 merged commit 260be2a into master May 12, 2020
@Stebalien Stebalien deleted the feat/routing-table-allocs branch May 13, 2020 20:24
@Stebalien Stebalien mentioned this pull request May 26, 2020
77 tasks
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.

None yet

2 participants