[3 / 1 / ?]

cache misses

No.7619731 ViewReplyReportDelete
what is the difference between a cache miss and a branch miss? I have this one snippet of code that is run very frequently, something like this

void f( type** x )
{
do stuff with (*x)
}

which resulted in a 40% cache miss according to perf, with 0.5% branch misses. I changed it slightly to

void f( type** x )
{
type* temp = *x;
do stuff with temp;
}

which resulted in a drop to 16% cache miss but the branch misses when up to 5%..

What is the difference, and why did the branch misses increase?