Re: [ROOT] How to accelerate root output?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Oct 31 2001 - 19:16:29 MET


Hi Thomas,

Difficult to come with a dignostic without looking into your system.
I have no idea of what you mean by "rather slow".
>From your class description, I conclude that you have about 20 Kbytes per event.
One million entries will make a file of about 20 GBytes.
Could you send me:
  - the result of tree.Print() after filling your Tree.
  - if possible your class with a small test that is slow.

Rene Brun

Thomas Bretz wrote:
> 
> 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