

Portability woes: Endianness and Alignment, Part 2 - tandemstrong
http://fastcompression.blogspot.com/2014/11/portability-woes-endianess-and.html

======
justin66
People should read Rob Pike's "The byte order fallacy," which was already
discussed here:
[https://news.ycombinator.com/item?id=3796378](https://news.ycombinator.com/item?id=3796378)

[http://commandcenter.blogspot.com/2012/04/byte-order-
fallacy...](http://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html)

~~~
vardump
I have a lot of respect for Rob Pike. Doing what he says guarantees correct
operation in typical cases, when the memory is cacheable. If CPU arch doesn't
support unaligned loads, the compiler must additionally be able to deduce
pointer alignment or it's forced to generate separate loads.

However, if performance is important, doing what Pike says doesn't always make
sense. The case discussed in the article in question is one those.

