Summary

Although most compilers now use the same memory mapping of base types, this is not always the case, and not all programmers are fully aware of the implications of choosing a certain base type. That is why it is important for implementers to familiarize themselves with the sizes, ranges, and accessing speed of the standard C/C++ variables of their target environment. This chapter discussed ways to evaluate variable characteristics and gave practical examples of optimal use.

  • Speed of variables

    Not all base types are equally fast in access and arithmetic. It is possible for the integer to be much faster than the float and double in all arithmetic operations except division, depending on the characteristics of the target platform. Also bit ...

Get C++ Footprint and Performance Optimization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.