Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Use same gob encoder/decoder for peers and peer connections #619

Merged
merged 4 commits into from
May 5, 2015

Conversation

awh
Copy link
Contributor

@awh awh commented Apr 29, 2015

Partially addresses #519 by merging the first two layers of gob.

@@ -25,6 +25,13 @@ type NameCollisionError struct {

type PeerNameSet map[PeerName]struct{}

type ConnectionView struct {

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@awh awh assigned rade Apr 29, 2015
@@ -233,7 +237,7 @@ func (peers *Peers) decodeUpdate(update []byte) (newPeers map[PeerName]*Peer, de
return
}

func (peers *Peers) applyUpdate(decodedUpdate []*Peer, decodedConns [][]byte) map[PeerName]*Peer {
func (peers *Peers) applyUpdate(decodedUpdate []*Peer, decodedConns [][]ConnectionView) map[PeerName]*Peer {
newUpdate := make(map[PeerName]*Peer)
for idx, newPeer := range decodedUpdate {
connsBuf := decodedConns[idx]

This comment was marked as abuse.

@rade
Copy link
Member

rade commented Apr 29, 2015

I am curious whether this change makes any difference to the time it takes NUM_WEAVES=50 bin/multiweave launch --connlimit 100 to settle. (NB: make sure you bump the kernel setting as described in bin/multiweave).

@rade rade assigned awh and unassigned rade Apr 29, 2015
@awh
Copy link
Contributor Author

awh commented Apr 30, 2015

I've made the suggested changes as well as introducing PeerSummary to tidy up peer encoding/decoding...

@awh awh assigned rade and unassigned awh Apr 30, 2015
@rade
Copy link
Member

rade commented Apr 30, 2015

The linter is moaning.

And the inclusion of ConnectionSummary in PeerSummary needs further-reaching changes to make sense, so I suggest leaving that out.

@rade rade assigned awh and unassigned rade Apr 30, 2015
@awh awh assigned rade and unassigned awh May 5, 2015
@rade rade merged commit ab68a1c into weaveworks:master May 5, 2015
@rade
Copy link
Member

rade commented May 5, 2015

This has made a massive improvement to cluster formation. Running NUM_WEAVES=50 bin/multiweave launch --connlimit=100 and measuring the time it takes from the first connection to quiescence, I get ~7 minutes on master, and ~2 minutes in this branch.

@rade rade modified the milestone: 0.11.0 May 12, 2015
@awh awh deleted the reduced_gob branch June 1, 2015 14:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants