Branch Predictor Study for a Cryptocurrency Hashing Library
Overview
What this challenge is about.
Profile the hot inner loop with perf record + perf annotate to identify the 5 highest-frequency branches. Measure per-branch mispredict counts using perf counters (BR_MISP_RETIRED). Repeat across the 3 processor generations (cloud instances acceptable). For the 2 worst-mispredicting branches, write a branchless alternative using conditional moves or bitmasking. Benchmark before/after on all 3 generations. Deliver the measurement report, the proposed PR with the branchless rewrite, before/after benchmarks per generation, and an upstream-ready commit message.
The Brief
What you'll do, and what you'll demonstrate.
Quantify branch mispredict cost in a cryptographic hot loop across 3 processor generations and ship a branchless rewrite of the worst offenders.
Earning criteria — what you'll demonstrate
- Use hardware performance counters to measure mispredict rates
- Reason about branch-predictor behavior across processor generations
- Write branchless code using conditional moves or bitmasking
- Validate optimization wins across multiple hardware targets
Program Fit
Where this fits in your program.
Sharpens the same skills your degree expects you to demonstrate.
Skills
Skills you'll demonstrate.
Each one shows up on your verified credential.
Careers
Roles this prepares you for.
Real titles. Real skill bridges. Pick the one closest to your trajectory.
Career mappings coming soon.