• Advertisement
Sign in to follow this  

Confused by the VTune profiling results

This topic is 1430 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

 

I am running my application through VTune to try to find performance bottlenecks. Most of the things it points out seem logical to me, but a certain scenario looks very weird. I attached a picture showing what I mean:

 

vtune.png

 

I hope the image shows all you need, but please ask for more info if you need it.

 

My question is regarding the highlighted row. How can incrementing a float value accessed through a reference take that long? Is there something fundamentally stupid about the code above, performance-wise, that would cause the highlighted row to take that long? And if so, what should I do to make it faster? Or, are the profiling results perhaps somehow incorrect?

 

The build I am running is a release build with "normal" VS settings and debug symbols. Ie. I have not adjusted anything in particular that would come to mind.

 

Any help you can give me is greatly appreciated. Cheers!

Share this post


Link to post
Share on other sites
Advertisement

The optimizer inlines, reorders and rewrites the code, so a line of C++ doesn't really have meaning anymore as the machine-code looks entirely different. The profiler tries to go backwards to find the C++ code that is responsible for execution time. It is probable that the generated code has everything reordered and the highlighted line is what causes any work to actually be done, so you can't really get anything more exact than adding 186 + 28 + 28 + 19 for the total loop cost.

You could go to ASM view to see what the assembly code looks like and get more exact readings.

Share this post


Link to post
Share on other sites

Probably, but then you wouldn't get very meaningful profiler results as it's the optimized code you want to know the performance bottlenecks for.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement