Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Request for comments/interest
From: Dave Handley (Dave.Handley_at_[hidden])
Date: 2010-05-28 15:35:00


"Scott McMurray" wrote:

> On 28 May 2010 13:44, Cliff Green <cliffg_at_[hidden]<mailto:cliffg_at_[hidden]>> wrote:

> >

> > Studies have been performed comparing "receiver makes right" designs (where

> > swapping is only performed by the receiver, if needed) with others. The

> > costs of swapping on modern processors is pretty minimal compared with the

> > design overhead and complexity, so "receiver makes right" many times is not

> > justified.

> >

>

> I understood it more as "we use little-endian for our network format,

> since most of our machines are little-endian, but still want to allow

> things to work on the couple of big-endian machines", not as "receiver

> makes right".

I need to reiterate that I was not talking about a "receiver makes right" design. I don't like these at all for complexity reasons. But in this day and age when a significant percentage of computers being sold are little-endian, deciding to make an internal protocol little-endian and almost completely eliminating endian swaps can make a lot of sense. If you are processing data off multiple 10Gb Ethernet feeds simultaneously, removing a single copy can make all the difference. Especially when you consider memory bandwidth constraints on a multi-threaded process. If you consider the hoops that C++0x has tried to jump through to make move semantics work, removing unnecessary copies, especially in a low level process, seems to be important to a lot of people.

Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk