Closed zslayton closed 2 months ago
For reference, here's the assembly generated by the conversion to LE bytes and to BE bytes on x86_64
:
Depending on your perspective, that's either a trivial difference or it's 100% more instructions! 😛
It does look pretty trivial (unless, perhaps, you're encoding lots of floats in a tight loop). We should see if there's a significant performance difference in Java (and maybe some other languages) to make a more informed decision.
Per team discussion, we're leaning little endian for consistency. Java's ByteBuffer
has an API for swapping endianness.
@zslayton, I'm going to close this as completed. Feel free to re-open if you disagree.
Our int encodings (including primitives) have switched to little endian in Ion 1.1 for a performance boost. Floats also rely on the CPU's native endianness, but the current version of the spec leaves them big endian.