binary protocol notes from the facebook hackathon

Alex alexs at
Wed Jul 11 22:23:35 UTC 2007

On Wed, Jul 11, 2007 at 01:08:07PM -0400, Tres Seaver wrote:
> Hash: SHA1
> ‏Alex Stapleton wrote:
> > On 11 Jul 2007, at 16:35, Tres Seaver wrote:
> > 
> > On one hand it's almost no performance hit, on the other,  
> > intentionally adding any performance penalty seems like a bad call.  
> > It would make implementation somewhat simpler to only support network  
> > ordering, and supporting both orders is probably not going to be  
> > justified the performance gains, which I imagine will be close to 0.
> Thanks for quantifying.  44 picoseconds per command seems pretty
> tolerable overhead to me.
> > +1 for network ordering only. (And I'm an Intel user ;)
> Agreed.  Given the possibility of pipeline stall on modern CPUs, it is
> quite credible that network-only implementation is faster, even on
> Intel, than one which sniffs the magic byte to determine whether to *do*
> the swapping.

I'm fairly sure it can be implemented *without* the need for special endian detection logic, but all the same, it seems to me that any extra effort put into supporting multiple byte orders would be mispent and optimising pretty much any other bit of the code would be a much more sensible use of time :)

More information about the memcached mailing list