Consider Binary Serialization for Floating Points #76

Closed
Neverlord opened this Issue Oct 1, 2012 · 2 comments

Projects

None yet

2 participants

@Neverlord
Member

libcppa currently serializes floating points as strings in order to be platform transparent. However, ArtemGr pointed out that it might be portable to use a binary format: 7331498#commitcomment-1878860.

If there's no platform (ARM? PowerPC?) with different floating point representation, then there's no point in using strings.

@ArtemGr
Contributor
ArtemGr commented Oct 2, 2012

Might keep the existing code as a compile-time option.

@Neverlord
Member

libcppa now uses IEEE 754 encoding on the network as a compromise between performance and platform-independency for float and double (based on http://beej.us/guide/bgnet/examples/pack2.c), but falls back to string serialization for long double. Reason being is that long double would be packed into a std::uint128_t ... which does not exist. Boost has such types in its multiprecision library, but adding boost only for this purpose might be overkill. Nevertheless, I am thinking of some type of uint128 type in the future, since strings are definitely not the answer.

@Neverlord Neverlord closed this Oct 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment