binary protocol notes from the facebook hackathon

Daniel Farina drfarina at
Wed Jul 11 16:57:17 UTC 2007

On 7/11/07, Steve Grimm <sgrimm at> wrote:
> On 7/11/07 12:45 AM, "marc at" <marc at> wrote:
> > While network byte ordering (Big Endian) is traditionally the 'right'
> > thing to do (or the default thing to do), in most cases it's a minor
> > performance hit due to constant swapping.  Since we're implementing a
> > binary protocol specifically to avoid/minimize minor performance hits
> > and since this is a brand new protocol I would recommend to keep all
> > values as Little Endian because:
> Defining a protocol that uses something other than network byte order gives
> me the willies. But I'm not sure I can argue with your reasoning on anything
> more than aesthetic grounds; swapping bytes around unnecessarily is exactly
> the sort of thing we're trying to avoid.

While we're at it, let's also supply a middle-endian byte-order so that
my PDP-11 can make the best use of its processing time.

One vote here for "do what everyone else is doing" and the "Principle of
Least Surprise," or network byte order.

In order be convinced I'd have to see some data that this kind of
peculiarity is worth it.


More information about the memcached mailing list