ILE C/C++ Programmer's Guide

Replacing Bit Fields with Other Data Types

Avoid using bit fields because it takes more time to access bit-fields than other data types such as short and int. Whenever possible, replace bit fields with other data types. If a bit field takes 16 bits and aligns on 2-byte boundary, you can replace it with the short data type.

Note:
You can still obtain a run-time improvement if the bit-field is smaller than the integral type. The extra time required for bit-field manipulation code offsets the performance gain due to space saved in data.


[ Top of Page | Previous Page | Next Page | Table of Contents ]