[zeromq-dev] Endianness conversion functions
Thomas Rodgers
rodgert at twrodgers.com
Tue May 12 04:36:33 CEST 2015
>
> (but it is on the criticl path for large messages)
If you were using this approach to encode fields in some general
serialization format, maybe it would make a measurable difference, but it
seems unlikely to do so relative to framing ZeroMQ messages. In the "worst"
case the put|get_uint64 (inlined) call is made once per message part in a
multi-part message to convert 8 bytes (for small frames it stores a single
octet).
See also - http://rfc.zeromq.org/spec:37
On Mon, May 11, 2015 at 3:56 PM, Auer, Jens <jens.auer at cgi.com> wrote:
> Hi,
>
> I've looking at the zeroMQ source code a little bit and was surprised that
> wire.hpp implements custom endianess converison function to convert 16, 32
> and 64 bit values from/to network byte-order. Is there any reason for not
> using available functions like hton* or htobe family on Linux? I am sure it
> is a micro-optimization (but it is on the criticl path for large messages),
> but recent Intel CPUs provide an assembler instruction which could be used
> with the __builtin_bswap64 intrinsic for gcc and icc.
>
> Best wishes,
> Jens
>
> --
> *Jens Auer *| CGI | Software-Engineer
> CGI (Germany) GmbH & Co. KG
> Rheinstraße 95 | 64295 Darmstadt | Germany
> T: +49 6151 36860 154
> *jens.auer at cgi.com* <jens.auer at cgi.com>
> Unsere Pflichtangaben gemäß § 35a GmbHG / §§ 161, 125a HGB finden Sie unter
> *de.cgi.com/pflichtangaben* <http://de.cgi.com/pflichtangaben>.
>
> CONFIDENTIALITY NOTICE: Proprietary/Confidential information belonging to
> CGI Group Inc. and its affiliates may be contained in this message. If you
> are not a recipient indicated or intended in this message (or responsible
> for delivery of this message to such person), or you think for any reason
> that this message may have been addressed to you in error, you may not use
> or copy or deliver this message to anyone else. In such case, you should
> destroy this message and are asked to notify the sender by reply e-mail.
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150511/f20d23aa/attachment.htm>
More information about the zeromq-dev
mailing list