We help IT Professionals succeed at work.

Truetime profiling with STL class templates

juhyunlim asked

Has anyone had any problems profiling template classes in Truetime? None of my source files for these template classes shows up in truetime, all other files that have a .h and a .cpp are fine. The only thing I can think of is that all the template class declarations/definitions are contained in a .h file, which is include by one .cpp file.
Anyone ever had this kind of trouble?
Watch Question

AxterSenior Software Engineer

What is Truetime?
Do you have a link?
I have a little experience using other performance measuring tools,  and I would say that with stuff like the STL you should take a lot of care decoding the results anyway.

The STL is designed to be very efficient,  and of particular relevance here is that it makes a *lot* of use of the ability of a compiler to inline code.  Most performance measuring tools cannot properly measure performance of inline code.  The only way that it can usually be done is to use a version of the code where inlining is turned off which obviously has a huge impact on the performance of the code, and hence is pointless.


I tried disabling all inlining just to see if my source
files would show up in true time, but no luck, same problem. Is there *any* profiling tool that can deal with this?

Not really, the problem is that once code has been inlined, the profiler cannot easily match the object code with the source code.

If you want to profile operations on the STL you could farm them off into functions that did only what you wanted to profile.  

This obviously can somewhat defeat the purpose of the profiling, however.

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "jasonclarke" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: http://www.experts-exchange.com/commspt

Per recommendation, force-accepted by
CS Moderator

Experts: please check for "Points For" questions -- there are a bunch in this TA.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.