default constructor as the hotspot

default constructor as the hotspot

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

10 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di Peter Wang (Intel)

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

The call stack pane shows the it was called 20 times. I am not sure if 20 times is a big number.

Regards,
Siddharth

Ritratto di Peter Wang (Intel)

Quoting sid9559The 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.

I did not get you. what does a statistical call mean??

regards,
Siddharth

Ritratto di Peter Wang (Intel)

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.

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

Ritratto di Peter Wang (Intel)

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

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

Ritratto di Peter Wang (Intel)

You need to care of the caller with high percent - which is a critical path in call stack to hot function.

Accedere per lasciare un commento.