Re: performance of a program with MakeClass vs MakeSelector, and global variable

From: John Idarraga <idarraga_at_cern.ch>
Date: Tue, 6 Jul 2010 16:22:12 -0400


Hello Marc,

You can tell what's different in time/call costs by using callgrind.

$ valgrind --tool=callgrind root.exe -q myTopLayerMacro.C

It'll run really slow, patience. At the end you get a file called

callgrind.out.XXXX

where XXXX is the pid. Open it with

$ kcachegrind callgrind.out.XXXX

voila ! ... you will see.

cheers !

John

On Tue, 2010-07-06 at 19:14 +0200, Marc Escalier wrote:
> Hello,
>
> i observed a strange phenomena with root (i guess it doesn't depend on
> the version, but just in case, it is root 5.22.)
>
> Let's consider a minimum program developped from a MakeClass() and a
> concurrent one with MakeSelector()
> *if the two programs don't fill histogram, i find the same performance
> in time of execution
>
> *if i fill the histogram with a MakeClass approach or a MakeSelector
> approach, for which the histogram has been declared in the main program
> as a global variable
> then the MakeSelector approach is about 10 times slower than the
> MakeClass approach (doing exactly same stuff) (and with desactivation on
> almost all the branches to speed up the process in the two cases)
>
> the program is something like :
>
> {
> Declaration of a histogram
> Call Instance of a Class and loop on it and fill the histogram with
> dummy values
> or
> Call Instance of a Selector and loop on it and fill the histogram with
> dummy values
> }
>
> *if now, i put the histogram in "local variables" in the class of the
> Selector (declaration in the header .h and memory allocation in the Begin())
> then the performance of the MakeSelector approach is twice faster as
> compared to the MakeClass approach
>
> Would you have an idea of the behaviour
>
> thank you very much
>
> just in case you would need more info on the program, it is here (lxplus) :
> /afs/cern.ch/user/e/escalier/public/ForRene
> time root -b -q -x main.C
> to see the differences to apply, you can replace the differences by
> making comment/uncomment of the parts with "option 1", "option 2",
> "option 3"
> (
> "grep option 1" *
> "grep option 2" *
> "grep option 3" *
> )
>
Received on Tue Jul 06 2010 - 22:07:52 CEST

This archive was generated by hypermail 2.2.0 : Wed Jul 07 2010 - 05:50:01 CEST