Cache Warming: Warm Up The Code
summary
Claim: pre-executing rarely used hot paths reduces latency but naive warming pollutes caches and skews branch predictors. Demo uses synthetic calls at ~10 Hz and shows added if-statements cause branch misprediction and slow real executions. Fix is to avoid conditionals by turning scalars into a two-counter array indexed by a warming flag so both code and data get warmed without changing real state. If branching cannot be removed, use compiler likely/unlikely hints as a fallback.
AI-written summary · about
related talks
01h 04mBranchless Programming in C++
51mJava vs CPU — round 2
01h 02mFastware
16mWhen is the Cache Warm? Manufacturing a Rule of Thumb
58mOptimization Tips - Mo' Hustle Mo' Problems
01h 05mPerformance Optimization in Software Development - Being Friendly to Your Hardware
01h 04mC++20’s [[likely]] Attribute - Optimizations, Pessimizations, and [[unlikely]] Consequences
51mDesigning for Performance
