News for hackers. Stuff that matters.
Re:How many branches can your CPU predict? by ErikCorry on Thursday March 19, 2026 @08:35PM (#47448627)
Yeah performance counters
Re:How many branches can your CPU predict? by cloudbonsai on Friday March 20, 2026 @03:00AM (#47451364)
To fill in the details, here is the code used for the measurement:

https://github.com/lemire/counters/blob/main/include/counter...

It fetches the number of mispredicted instructions from Linux's perf subsystem, which in turn gathers the metrics from CPU's PMU (Performance Monitoring Unit) interface.