On 04/05/2014 02:21 AM, Pedro Larroy wrote:
> Please have a look at the discussion
> in:
https://github.com/jewel/clearskies/pull/48
>
> Should we use ascii or binary for lengths? If we move towards a binary
> protocol, we should consider using a more efficient encoding such as
> msgpack rather than json.
>
> What do you guys think?
I think it's really up to you. I don't see a compelling argument on
either side unless someone wants to go to the trouble of changing the
code. In the meanwhile I think we'd be better off focusing on getting
something working first, and then we can optimize based on real-world
measurements.
msgpack seems like it'd be fine. I looked at using protobufs
originally, but it turns out that they're not as flexible as we'd want
for our protocol. While message types can be extended with new
attributes, it can only be done via a central authority, whereas I think
that for clearskies I'd be better if we have a wide-open forwards
compatibility.
Since msgpack can take raw bytes, we could simplify things further.
However, we'd probably still want to keep the chunked method of sending
binary data so that it's easy to stream large files.
I suggested this switch because the protocol is text-based for
historical reasons -- when I wrote the protocol originally there was no
implementation, and I didn't know how it'd be encrypted. Now that
things are getting more concrete it doesn't seem like it will matter, so
we might as well go with whatever is easiest for the C++ implementation.
Steven