Understanding Data Alignment

Aligning data on boundaries can help performance. The IntelŪ compiler attempts to align data on boundaries for you. However, as in all areas of optimization coding practices either help or hinder the compiler and can lead to performance problems. Always attempt to optimize using compiler options first. See Optimization Options Summary for more information.

To avoid performance problems you should keep the following guidelines in mind, which are separated by architecture:

IA-32, IntelŪ EM64T, IntelŪ ItaniumŪ architectures:

IA-32 and IntelŪ EM64T architectures:

ItaniumŪ architecture:

In general, keeping data in cache has a better performance impact than keeping the data aligned. Try to use techniques that align the data without greatly expanding data size.

See Setting Data Type and Alignment for more detailed information on aligning data.