qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Stitcher" <astitc...@apache.org>
Subject Re: Review Request: Avoid using ntohl()/ntohs()/htonl()/htons()
Date Fri, 07 Dec 2012 16:42:18 GMT


> On Dec. 7, 2012, 9:19 a.m., Cliff Jansen wrote:
> > This looks good from a portability perspective.  But it must present a performance
penalty on big endian hardware, though I can't quantify the amount.  Are these functions not
available on some platform?

I'd actually be surprised if there was much/any performance problem here since the new functions
are inlined and the compiler should be able to do just as good a job. Asa data point this
is what we do in qpid and there is no slowdown there.

Another point: the previous code can perform unaligned memory access, which can be a problem
on some platforms, whereas this code avoids this issue.


- Andrew


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/8385/#review14146
-----------------------------------------------------------


On Dec. 6, 2012, 11:10 p.m., Andrew Stitcher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/8385/
> -----------------------------------------------------------
> 
> (Updated Dec. 6, 2012, 11:10 p.m.)
> 
> 
> Review request for qpid, Cliff Jansen and Rafael Schloming.
> 
> 
> Description
> -------
> 
> Removed the use of [nh]to[hn][ls] in the ANSI only part of the code as they are part
of BSD sockets API not in ANSI C.
> 
> There is now some duplication of code which should be removed, but nothing serious in
my opinion.
> 
> 
> This addresses bug PROTON-121.
>     https://issues.apache.org/jira/browse/PROTON-121
> 
> 
> Diffs
> -----
> 
>   /proton/trunk/proton-c/src/codec/codec.c 1417656 
>   /proton/trunk/proton-c/src/framing/framing.c 1417656 
> 
> Diff: https://reviews.apache.org/r/8385/diff/
> 
> 
> Testing
> -------
> 
> Compiled under Fedora and run proton-test against the built code.
> 
> 
> Thanks,
> 
> Andrew Stitcher
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message