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 can either help or hinder the compiler and can lead to performance problems.

Always attempt to optimize using compiler options first.

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

IA-32, IntelŪ 64, and IA-64 architectures:

IA-32 and IntelŪ 64 architectures:

IA-64 architecture:

In general, keeping data in cache has a better performance impact than keeping the data aligned. Try to use techniques that conform to the rules listed above.

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