Performance of std::pow - cache misses???

Posted by Eamon Nerbonne on Stack Overflow See other posts from Stack Overflow or by Eamon Nerbonne
Published on 2010-03-20T19:06:09Z Indexed on 2010/03/20 19:11 UTC
Read the original article Hit count: 550

Filed under:
|
|
|

I've been trying to optimize a numeric program of mine, and have run into something of a mystery. I'm looping over code that performs thousands of floating point operations, and just 1 call to pow nevertheless, that call takes 5% of the time... That's not necessarily a critical issue, but it is odd, so I'd like to understand what's happening.

When I profiled for cache misses, VS.NET 2010RC's profiler reports that virtually all cache misses are occurring in std::pow... so... what's up with that? Is there a faster alternative? I tried powf, but that's only slightly faster; it's still responsible for an abnormal number of cache misses.

Why would a basic function like pow cause cache-misses?

© Stack Overflow or respective owner

Related posts about cache

Related posts about cpu