© Andrey Akinshin 2019
Andrey AkinshinPro .NET Benchmarkinghttps://doi.org/10.1007/978-1-4842-4941-3_7

7. CPU-Bound Benchmarks

Andrey Akinshin1 
(1)
Saint Petersburg, Russia
 

Knock, knock.

Branch prediction.

Who’s there?

— A classic programming joke

One of the most common bottlenecks in many benchmarks is CPU. Proper design and analysis of CPU-bound benchmarks require knowledge of different runtime and hardware “features” that can affect performance. Each .NET runtime has a lot of different optimizations that can improve (or spoil) performance of your code. Each CPU microarchitecture has a lot of low-level mechanisms that also affect measurements. If you are not aware of these optimizations and mechanisms, it’s hard to design some benchmarks ...

Get Pro .NET Benchmarking: The Art of Performance Measurement 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.