Data alignment is an important issue for all programmers who directly use memory. Data alignment affects how well your software performs, and even if your software runs at all. As this article illustrates, understanding the nature of alignment can also explain some of the “weird” behaviors of some processors.
Generally useful generic advice! Thanks!!
/me goes to pass it around at work
Pretty much knew this stuff for years, but the first time I have seen graphs to get a feel of the diffirences.
Must admit I never thought of data alignment done by software would be so slow, any OS that supports that should also put up a dialog box if the function is called to warn that the software is basicly broken.
Eugenia,
My compliments to the author. Today, many programmers are blind-sided by the performance implications of unaligned references, particularly when they are generated by the use of pointers.
Without digging in my library, I would have to say that unaligned data became a performance issue, rather than a straightforward fault, with the advent of the IBM System/370 byte-aligned operand feature. Many systems since have hidden the “problem”, although significant performance problems are often the side effect.
The advent of the RISC-generation, increased the performance problem severely. Direct unaligned references could be handled by compilers, but structures passed by pointers are a different beast altogether. References which actually cause a fault, can incur VERY severe performance penalties.
– Bob Gezelter, http://www.rlgsc.com