Boost logo

Boost :

Subject: Re: [boost] [Review] Boost.Endian mini-review
From: Jason Newton (nevion_at_[hidden])
Date: 2015-01-25 18:12:39


On Sun, Jan 25, 2015 at 8:21 AM, Beman Dawes <bdawes_at_[hidden]> wrote:

> On Sat, Jan 24, 2015 at 2:25 AM, Jason Newton <nevion_at_[hidden]> wrote:
> > I think the only thing that I have no interest in using - a kind way of
> > saying its probably unneeded bloat IMO is the arithmetic types. I prefer
> > native types and using conversion functions. But maybe they could
> improve
> > my code - its something I toss back and forth a little and haven't
> > attempted embracing.
>
> Because even the endian buffer and arithmetic types that appear most
> expensive generate only short sequences of code, the optimizing
> compilers often generate exactly the same instructions regardless of
> endian approach. On Intel machines, that often distills down to a
> single bswap instruction since the value is already in a register.
>
> That isn't always true, so you do need to measure performance of
> various approaches in the context of your actual application. But if
> use of the buffer or arithmetic types would otherwise improve your
> code, please don't reject them without actually testing performance
> first.
>

Allow me to clarify: I meant code bloat, not speed.

-Jason


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