[ROOT] How to accelerate root output?

From: Thomas Bretz (tbretz@uni-sw.gwdg.de)
Date: Wed Oct 31 2001 - 14:02:37 MET


Hello rooters,

I'm writing data like in the following example (using root 3.01/06, with
a '+' in the pragma statement for MyClass):

{
MyClass *cls = new MyClass;

TFile file("name", "RECREATE", "title", 0);
TTree tree("name, "title");
tree.Branch("MyClass", "MyClass", &cls, 320000, 0);

for (int i=0; i<1e6; i++)
{
   FillDataIntoMyClass(&cls);
   tree.Fill();
}
file.Write();
delete cls;
}

Because this is rather slow, I used gprof to find out where the time is
spend and if I trust its output, only ~15% of all the time (CPU time,
which should not include I/O) is spend in my part of the program. This
means about 85% of the CPU-time is spent in root (I/O). In this example
speed is really critical. Is there a way to accelerate the root output?

I don't think that it is a question of hardware limitation because the
machine and disks are really powerfull.

Rem: MyClass contains four arrays. Two about 1kB, and two around 8kB.
(around 18kB in total)

Thanks in advance,
Thomas.



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:05 MET