Use VTune to determine optimal function inlining?

Use VTune to determine optimal function inlining?

I have inherited a project that has speed and size constraints. It currently has I think too many methods inlined, and to make code smaller, I want to only inline functions that actually increase performance. How can I use Vtune to determine this?
Thanks,
Brian

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

If you are using a Pentium 4 you should see how efficiently you are using the trace cache. If you have excessive inlining the code will be too big to fit in the trace cache and you will have a lot of misses. I suggest that you use measure the following ratios: TC Delivery Rate and Trace Cache (TC) Miss Performance Impact. This will tell you if you have excess trace cache misses.

This is for a Pentium 3.

Hi Brian,

In my mind call graph can help you a lot with this task.
You'll get the # of times the function was called and the numer of functions that called it.
my advice is "more time the function was called from less places(# of callers)" - a good candidate to be inlined.

Some more VTune useful features:
-you can define your own ratios, like "#of calls / # of callers" and you can sort all functions by this new ratio column in call graph view.

-there is possibility to see "call list" by "call sites" e.g. func A calls func B from 5 different code lines inside the func A. you can see this also in VTune.

-Daniel

Leave a Comment

Please sign in to add a comment. Not a member? Join today