Re: benchmarking TClonesArray vs STL vector

Rene Brun (Rene.Brun@cern.ch)
Wed, 16 Dec 1998 18:53:48 +0100


Hi Chris,
There are several differences between your options and the options
I use to build Root with KCC under SGI. See my options below.
Note that I compile with maximum optimisation K3 and I do not
have any problems in running. I have run Pasha's test program
comparing STL and TClonesArray. Here is the output:
$ test3.exe 1
**********************************************************
do_access: 1 nmax : 5000 nevents : 1000
**********************************************************
-- vector of objects : RealTime=11.970000 seconds, CpuTime=11.790000
secondssum = 50000.000000
-- vector of pointers : RealTime=25.620000 seconds, CpuTime=25.320000
secondssum = 50000.000000
-- TClonesArray : RealTime=7.520000 seconds, CpuTime=7.490000
secondssum = 50000.000000

(by the way showing a nice factor of 3 in favour of Root TClonesArray!!)

The options used: (note that this makefile is part of the standard
distribution)

Rene Brun

PLATFORM = sgi

CXX = KCC
CC = cc
CXXFLAGS = --signed_chars --display_error_number --diag_suppress 68
\
--diag_suppress 191 +K3
CFLAGS = -signed
CINTCXXFLAGS = --signed_chars --display_error_number --diag_suppress 68
\
--diag_suppress 191 -DG__REGEXP1 -DG__UNIX
-DG__SHAREDLIB \
-DG__OSFDLL -DG__SIGNEDCHAR -DG__DECCXX -DG__ROOT \
-DG__REDIRECTIO +K3
CINTCFLAGS = -signed -w -DG__REGEXP1 -DG__UNIX -DG__SHAREDLIB \
-DG__OSFDLL -DG__SIGNEDCHAR -DG__DECCXX -DG__ROOT \
-DG__REDIRECTIO
OPT = -g
NOOPT =
LD = KCC
LDFLAGS = $(OPT) -Wl,-u,__builtin_new -Wl,-u,__builtin_delete \
-Wl,-u,__nw__FUiPv
SOFLAGS =
SOEXT = so
SYSLIBS = -lg++ -lm -ldl
SYSXLIBS = -lX11 -lm -lPW -ldl
XLIBS = $(ROOTSYS)/lib/libXpm.a -lX11
CILIBS = -lm -ltermcap -lbsd -ldl

Chris Green wrote:
>
> > I have now a few comments concerning Chris Green's mail.
> > We do not play any special trick in TClonesArray. We simply exploit
> > at best a standard (and not well known) C++ functionality.
> > Chris mentions reliability problems with TClonesArray.
> > Could you forward to us any evidence/description of these problems?
>
> Hi, Rene.
>
> I wasn't suggesting you used any `tricks'. I was merely trying to suggest
> that it may be possible to write an allocator for an STL container which
> will do the same intelligent things regarding object/memory reuse as your
> TClonesArray. It may not, of course -- I haven't studied either
> TClonesArray or STL allocators in the required detail.
>
> As for the problems, I was using 2.00/13 compiled with KCC v3.3f on Linux
> glibc2 using gcc 2.7.2.3 for the C compiler at optimization levels K2 (for
> C++) and O2 (for C) (I re-wrote the other makefiles slightly to cope with
> OPTS and COPTS). The compile flags were as follows:
>
> CXXFLAGS = --signed_chars -D_EXTERN_INLINE=inline \
> --display_error_number \
> --diag_suppress 191 -fPIC -I$(OPENGL)/include -DR__GLIBC
> CFLAGS = -Wall -fPIC -DR__GLIBC
> CINTCXXFLAGS = --signed_chars -D_EXTERN_INLINE=inline \
> --display_error_number \
> --diag_suppress 191 -fPIC -DG__REGEXP -DG__UNIX
> -DG__SHAREDLIB \
> -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO
> CINTCFLAGS = -Wall -fPIC -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \
> -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO
>
> The dictionaries were copied rather than generated -- they could not be
> generated successfully.
>
> I compiled Pasha's benchmarking program (K2 or K0, it doesn't matter).
> When running (eg) 10000 events of 1000 nodes, the program crashes in the
> constructor for TObject after 2094 events. I would suggest though, that
> you try to do the same thing with your latest version of ROOT rather than
> duplicate my problem with an older version.
>
> I hope this is enough information to allow you to reproduce the problem.
>
> Cheers,
> Chris.
>
> --
> Chris Green. HEP, Purdue University. CDF SVXII project.
> Based at Fermilab. MAIL greenc@fnal.gov; PHONE (630) 840-2308