Skip to content
Tech News
← Back to articles

Efficient C++ Programming for Modern 64-bit CPUs: Chapter 4/part 2

read original more articles
Why This Matters

This chapter highlights the importance of understanding CPU operation costs, especially for multiplication and division, to optimize C++ code for modern 64-bit architectures. Recognizing these performance characteristics enables developers to write more efficient programs, reducing execution time and resource consumption in demanding applications.

Key Takeaways

This is a DRAFT of the second part of Chapter 4 - On CPU Physics and CPU Cycles, of the Vol.1 of an upcoming book "Efficient C++ Programming for Modern 64-bit CPUs" by Sherry Ignatchenko and Dmytro Ivanchykhin. Feel free to comment on it - especially if you see some factual inconsistencies, we'll be happy to fix them.

For the first part of Chapter 4, see https://6it.dev/blog/on-cpu-physics-and-cpu-cycles-80730.

Cold Hard Numbers

Now, armed with all the information above (and adding bits from [Ignatchenko16a], [Fog], and other sources listed below), we can make an all-important diagram to replace micro-benchmarks for many practical purposes, and indicate costs of most popular operations in the dev’s vocabulary.

DISCLAIMER: all the numbers below are accurate only within an order of magnitude!

... continue reading