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

From: Marc Escalier <escalier_at_lal.in2p3.fr>
Date: Tue, 6 Jul 2010 19:14:55 +0200


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 - 19:20:22 CEST

This archive was generated by hypermail 2.2.0 : Tue Jul 06 2010 - 23:50:01 CEST