Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4975 Discussions

default constructor as the hotspot

sid9559
Beginner
459 Views
Hello ,

I am doing some hotspot analysis on Image quality assesment algorithms. I found that my one of the default consructor is a hotspot.

// default constructor

template

inline GBuffer::GBuffer(

size_type width,

size_type height

) : pData_(NULL), width_(width), height_(height),

tagX_(0), tagY_(0), sleeping_(false)

{

UpdateMemory(true);

}


when i click on the buttom up analysis and go to the source code. I am pointed to the

{

UpdateMemory(true);

}


I cannot understand what is wrong and why my constructor is a hotspot.

regards,
Siddharth

0 Kudos
9 Replies
Peter_W_Intel
Employee
459 Views
I suspect that your code created many objects by using this construct (class GBuffer?).So UpdateMemory() will be called frequently...it'swhyUpdateMemory() consumed high CPU time.

You canreview call stack to know where it happened.

Regards, Peter
0 Kudos
sid9559
Beginner
459 Views
The call stack pane shows the it was called 20 times. I am not sure if 20 times is a big number.

Regards,
Siddharth
0 Kudos
Peter_W_Intel
Employee
459 Views
Quoting sid9559
The call stack pane shows the it was called 20 times. I am not sure if 20 times is a big number.

Regards,
Siddharth

That is statistical call, not real call count.

0 Kudos
sid9559
Beginner
459 Views
I did not get you. what does a statistical call mean??

regards,
Siddharth
0 Kudos
Peter_W_Intel
Employee
459 Views
Statistical call graph means, the tool doesn'trecord all executions in function entry - uses sampling data collection to capture samples in function, and know callerfrom stack walk info. In this way, thetool finds all hot functions (source lines) with caller's info, but call count is not the REALfunction'sexecutionnumber.
0 Kudos
sid9559
Beginner
459 Views
OK i get your point. Just to be sure, the tool takes samples at a predefined interval by interupting the execution and uses the instruction pointer to find out the function and the function which shows the maximum samples is a hotspot.

But still i do not understand how is the information from the call stack going to help me tune the program and remove my default constructor as a hotspot.

Also,from the call stack panei can see that my constructorhas been called say 'x' times. Could you please explain me the significance of this number.


Regards,
Siddharth
0 Kudos
Peter_W_Intel
Employee
459 Views
You may consider if UpdateMemory() in constructor is necessary - review your algorithm, is it possile to remove UpdateMemory to member function, and call it when necessary...

If you keep UpdateMemory() in constructor, you may tune UpdateMemory() to reduce cycles, for example - predefined analysis "general exploration" to find issues in microarchitecture, i.e. cache misses, branch misprediction, etc.

Regards, Peter
0 Kudos
sid9559
Beginner
459 Views
Alright, it makes sense. I will try that out and see what happens. Also, as i asked you previously, what is the significance of the number of calls shown in the call stack pane and how is that usefull. could you explain me breifly??

regards,
Siddharth
0 Kudos
Peter_W_Intel
Employee
459 Views
You need to care of the caller with high percent - which is a critical path in call stack to hot function.
0 Kudos
Reply