Floating-point and mixed-endianness in D-Bus (was: dbus mini-summit)
Rémi Denis-Courmont
remi at remlab.net
Tue Aug 9 12:38:50 PDT 2011
Le mardi 9 août 2011 22:20:41 Havoc Pennington, vous avez écrit :
> I don't think there needs to be a performance issue for the
> conditional conversion. It does not need to be more than one
> conditional per message in theory, which will not be even remotely a
> measurable overhead.
I don't really see how you'll make this into a single check, unless maybe you
just convert the whole message buffer to native endianess at the time of
reception.
Sure, you could check once and then select a table of function pointers based
on that one-time check. But function pointers are just as slow as branching,
probably even slower, as they break prediction. Furthermore, you'll get the
function call overhead.
> If going to fixed byte order, then I'd probably go with little endian,
> because it seems sucky to have the swap overhead in the 95% case
> instead of the 5% case.
Sure. Little endian is not unique to CPUs :-)
Or there is also the option of not interoperating buses of different
endianess. Even in the rare networked D-Bus case, that mixed endianess should
be an exception.
--
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
More information about the dbus
mailing list