----- Original Message -----
From: <rhatcher@SLAC.stanford.edu>
To: <roottalk@pcroot.cern.ch>
Sent: 31 марта 2000 г. 21:19
Subject: Re: delete time for complex geometries
> > Hello Robert,
> > I did reproduce the time you reported and it seems to me my first guess ("garbage collection")
> > was a wrong one. The collection is not activated for TNode's.
> > I have no explanation yet.
> >
>
> I hacked in enough #includes, forward declaration and fixed up an what
> turns out to be an attempt to modify a constant string and got everything
> to compile using .L time_geom.C++. This reduces the overhead where
> I'd expect it, but did nothing for the destruction time (as one would
> expect since the interpreted form simply has to find/call the TGeometry
> destructor).
>
Hi, Robert
Can you try to imitate the TGeometry dtor and to estimate how many time each piece
consumes.
I can try myself tomorrow only.
You will need:
class TGeometry ... {
THashList *GetListOfShapes() const {return fShapes;}
TList *GetListOfNodes() const {return fNodes;}
THashList *GetListOfMaterials() const {return fMaterials;}
THashList *GetListOfMatrices() const {return fMatrices;}
}
TGeometry::~TGeometry()
{
if (!fMaterials) return;
fMaterials->Delete();
fMatrices->Delete();
fShapes->Delete();
fNodes->Delete();
delete fMaterials;
delete fMatrices;
delete fShapes;
delete fNodes;
delete [] fMaterialPointer;
delete [] fMatrixPointer;
delete [] fShapePointer;
fMaterials = 0;
fMatrices = 0;
fShapes = 0;
fNodes = 0;
fMaterialPointer = 0;
fMatrixPointer = 0;
fShapePointer = 0;
if (gGeometry == this) {
gGeometry = (TGeometry*) gROOT->GetListOfGeometries()->First();
if (gGeometry == this)
gGeometry = (TGeometry*) gROOT->GetListOfGeometries()->After(gGeometry);
}
gROOT->GetListOfGeometries()->Remove(this);
}
> -robert
>
> ==================================
>
> build geometry nplanes=48 nstrips=192
> cummulative time
> basics Real time 0:0:0, CP time 0.000
> matrices Real time 0:0:0, CP time 0.000
> shapes Real time 0:0:0, CP time 0.250
> nodes Real time 0:0:0, CP time 0.600
>
> done building
>
> shape list has 9266 entries
>
> world node has 51 sub-nodes
>
> destroy geometry Real time 0:0:15, CP time 14.910
> done destruction
>
> root [2] time_geom(484,0);
>
> build geometry nplanes=484 nstrips=192
> cummulative time
> basics Real time 0:0:0, CP time 0.010
> matrices Real time 0:0:0, CP time 0.010
> shapes Real time 0:0:3, CP time 3.110
> nodes Real time 0:0:6, CP time 6.440
>
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:22 MET