Menu

Infographics: Operation Costs in CPU Clock Cycles, Take 2 - 6IT
📰

Infographics: Operation Costs in CPU Clock Cycles, Take 2 - 6IT

Hacker News·5 months ago
#pMb1rBpI
#6it#cycles#function#cost#costs
Reading 0:00
15s threshold

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!

Note that some of the items here were not discussed above, and may need some additional explanation:

Multiplication / Division

Out of all the R-R operations out there, multiplication and especially division are…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.