Overview
Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the intricacies of C++20's [[likely]] and [[unlikely]] attributes in this CppCon conference talk. Dive deep into branch prediction, optimizations, and pessimizations while learning the art of benchmarking. Investigate the meaning of these attributes, the risks associated with their use, and whether they're worth implementing. Gain valuable insights into performance tuning and discover how to focus efforts on elements that truly impact performance. Benefit from the expertise of Amir Kirsh and Tomer Vromen as they guide you through topics such as code layout, CPU predictors, early returns, exceptions, and actual benchmarks. Enhance your understanding of C++ performance optimization techniques and learn to make informed decisions when using these new language features.
Syllabus
Introduction
Why do we need it
Code Layout
Bench Predictor
CPU Predictor
Cold Branch
Indirect Branch
Likely vs unlikely
Early return
Exceptions
Likely unlikely macro
Actual Benchmark
Comparison
The Benchmark
The Result
Switching Order of Declaration
Why are they the same
Benchmark
Perf
Summary
Questions
Syntax placement
If is unlikely
Bad Hints
Predictors
Not Optimal
Taught by
CppCon