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

Improve Relay command encoding scheme #837

Closed
kevsmith opened this issue Jul 5, 2016 · 1 comment
Closed

Improve Relay command encoding scheme #837

kevsmith opened this issue Jul 5, 2016 · 1 comment
Milestone

Comments

@kevsmith
Copy link
Member

kevsmith commented Jul 5, 2016

Relay uses Go's encoding/gob to send invocation requests and receive invocation responses. It turns gob is one of the most verbose and slowest binary encodings currently available for Go.

A minimal command invocation request (executable set to "/bin/date", no Cog args, no Cog opts) weighs in at 171 bytes when gob encoded. This is surprisingly large.

@kevsmith kevsmith added the relay label Jul 5, 2016
@kevsmith kevsmith added this to the Cog 0.9.0 milestone Jul 5, 2016
@kevsmith kevsmith changed the title Improve Relay <--> command encoding scheme Improve Relay command encoding scheme Jul 5, 2016
@kevsmith
Copy link
Member Author

kevsmith commented Jul 5, 2016

Based on Alec Thomas' Go serialization benchmarks I've replaced gob with gogo/protobuf as this seems to be both the fastest codec and marshaling scheme available.

The same minimal command invocation serializes to only 40 bytes. This represents a 76.6% decrease in payload size.

@kevsmith kevsmith closed this as completed Jul 5, 2016
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

No branches or pull requests

1 participant