Chapter 3: CPU Architecture, Resources, and Performance
With this chapter, we begin the exploration of the computing hardware: we want to know how to use it optimally and squeeze the best performance from out of it. The first hardware component we have to learn about is the central processor. The CPU does all the computations, and if we are not using it efficiently, nothing is going to save our slow, poorly performing program. This chapter is dedicated to learning about CPU resources and capabilities, the optimal ways to use them, the more common reasons for not making the best use of CPU resources, and how to resolve them.
In this chapter, we're going to cover the following main topics:
- The architecture of modern CPUs
- Using internal concurrency of the CPUs for optimum performance
- CPU pipelines and speculative execution
- Branch optimization and branchless computing
- How to evaluate whether a program uses CPU resources efficiently