How do you measure the effect of branch misprediction?

Posted by Matt Wamboldt on Stack Overflow See other posts from Stack Overflow or by Matt Wamboldt
Published on 2010-05-20T21:22:32Z Indexed on 2010/05/20 21:30 UTC
Read the original article Hit count: 208

Filed under:
|

I'm currently profiling an implementation of binary search. Using some special instructions to measure this I noticed that the code has about a 20% misprediction rate. I'm curious if there is any way to check how many cycles I'm potentially losing due to this. It's a MIPS based architecture.

© Stack Overflow or respective owner

Related posts about c++

Related posts about branches