Lightning Talk: Using This Correctly it's [[unlikely]] at Best
summary
C++20 attributes likely and unlikely are concrete compiler hints that aim to bias code layout and inlining rather than magically speed hot paths. The claim is that marking cold branches can move code into colder pages and reduce footprint, but microbenchmarks mislead and superscalar speculation defeats naive expectations. Example: marking a helper as unlikely causes GCC to move the inline out but clang keeps it, so effectiveness depends on placement, compiler and at-scale measurement.
AI-written summary · about
chapters (6)
- 0:00Intro
- 0:21Likely and unlikely
- 1:20What likely and unlikely actually solves
- 2:02Likely
- 3:48More Details
- 4:08Quote
related talks
05mDetecting Programs That Rely on Undefined Behavior
06mLightning Talk: You Should Use AddressSanitizer
36mLightning Talks I
02h 44mMeasure, don’t guess: benchmarking stories from the trenches
01h 12mWriting robust code
01h 09mLocknote: Local Reasoning in C++
26mUndefined Behavior in 2017 (part 2 of 2)
05mLightning Talk: Can you Trust that Benchmark?
