I must be doing something stupid or using perf incorrectly ?
#include <iostream>
int main()
{
return 0;
}
Compile command (Using g++-9.2.1)
g++ -std=c++17 -Wall -Wextra -pedantic -O3 Source.cpp -o prog
Following the tutorial
stat Run a command and gather performance counter statistics
I attempted
perf stat ./prog
And in the output
560,957 branches # 303.607 M/sec
16,181 branch-misses # 2.88% of all branches
The question is why? should I "clean" the registers before running this command? is this normal?