I tried to optimize my digital program and ran into something mysterious. I iterate over a code that performs thousands of floating point operations, of which 1 is a pow call - however, this call takes 5% of the time ... This is not necessarily a critical problem, but it's weird, I like to understand what is happening.
When I was profiling for cache skips, the VS.NET 2010RC profiler reports that almost all of the cache misses occur in std::pow ... so ... what's up with that? Is there a faster alternative? I tried powf , but it is only a little faster; he is still responsible for the abnormal amount of cache misses.
Why does a main function like pow cause cache misses?
Edit: This is not managed code. /Oi enabled, but the compiler may choose to ignore this. Replacing pow(x,y) with exp(y*log(x)) has similar performance - now all cache misses are in the log function.
c ++ profiling caching cpu
Eamon nerbonne
source share