benchmarking TClonesArray vs STL vector

Pasha Murat (murat@cdfsga.fnal.gov)
Tue, 15 Dec 1998 19:51:47 -0600 (CST)


Hi Rooters,

I finally found some time to benchmark ROOT TClonesArray against STL vectors.
Briefly the results: for HEP-like applications (loop over the events) TClonesArray seems
to be more efficient than STL vectors even if no sorting of the objects is involved.
On SGI IRIX6.2 (R10000) the test code using TClonesArray runs about 50% faster than
similar code using STL vector of objects and about 3 times faster than the code using STL
vector of pointers.

The results on Linux are similar, those are preliminary though.

While satisfied, I do not quite understand why TClonesArray performed in this test
faster than vector. It is also clear that when the sorting will be involved the
difference should become even more striking. May be there is something in my code
I don't see?

See the description of the test conditions and the complete source code of the program
executed (including the Makefile) at URL

http://www-cdf.fnal.gov/upgrades/computing/projects/run2mc/run2mc.html

(see news from Dec 14, this includes a little bit of advertisement of new CDF MC web page),

a direct pointer is:

http://www-cdf.fnal.gov/upgrades/computing/projects/run2mc/minutes/1998_12_10/TClonesArray_vs_vector.html

I appreciate any comments, regards, pasha.