Re: Write method very slow

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Tue, 20 Feb 2007 08:55:09 +0100


Eric,

I tested your script on Windows, Mac and Linux. On all these systems your macro executes
in about 30 ms real time and the output gives Root [0] .x test.C
Temps CPU pour ouvrir l'interface = 0.020000 seconds

Rene Brun

eric.houla_at_free.fr wrote:
> Hi René!
>
> I attached the two files.
> Executing this small code, it takes for me ~2s CPU for writing 2 empty graphs
> inside my root file.
>
> Thank you .
>
>
> Selon Rene Brun <Rene.Brun_at_cern.ch>:
>
>
>> Eric,
>>
>> Are you really running ROOT version 5.16.16 ??
>> In your short script, you do not test the I/O speed, but the time for
>> Windows to load a dll.
>>
>> Please (as I requested) send a complete running macro to test your
>> problem. We cannot do anything with your 4 lines.
>>
>> Rene Brun
>>
>> eric.houla_at_free.fr wrote:
>>
>>> Hi René,
>>>
>>> I can run the macro only with:
>>> {
>>> TStopwatch timer;
>>> timer.Start();
>>> TGraph *g1= new TGraph() ;
>>> TGraph *g2= new TGraph() ;
>>> gSystem->Load("SaveData_C.dll");
>>> SaveData(g1,g2) ;
>>> printf("Temps CPU pour ouvrir l'interface = %f
>>>
>> seconds\n",timer.CpuTime());
>>
>>> }
>>>
>>> It take only for that 2 seconds CPU.
>>>
>>> I'm using ROOT v5.16.16.
>>>
>>>
>>>
>>> Selon Rene Brun <Rene.Brun_at_cern.ch>:
>>>
>>>
>>>
>>>> What do you mean by very slow, hours, minutes, seconds, microseconds?
>>>>
>>>> Could you provide a simple but running script demonstrating the problem?
>>>>
>>>> Which version of ROOT?
>>>>
>>>> Rene Brun
>>>>
>>>> eric.houla_at_free.fr wrote:
>>>>
>>>>
>>>>> Hi all!
>>>>>
>>>>> I have written this small macro:
>>>>> #include <TROOT.h>
>>>>> #include <TFile.h>
>>>>> #include <TGraph.h>
>>>>> #include <TMultiGraph.h>
>>>>>
>>>>> void SaveData(TGraph *g1, TGraph *g2);
>>>>>
>>>>> void SaveData(TGraph *g1, TGraph *g2)
>>>>> {
>>>>>
>>>>> TFile *f = new TFile ("test.root", "RECREATE");
>>>>> g1->Write("g1");
>>>>> g2->Write("g2");
>>>>> delete f;
>>>>>
>>>>> }
>>>>>
>>>>> and i compiled it with .L SaveData.C++
>>>>>
>>>>> But the process for writing the objects in the TFile is "very" long.
>>>>> Is there no way to boost it ??
>>>>>
>>>>> Thank you all!
>>>>>
>>>>> Regards.
>>>>>
>>>>>
>>>>>
>>>
>>
>
>
>
> ------------------------------------------------------------------------
>
> {
> TStopwatch timer;
>
> TGraph *g1= new TGraph() ;
> TGraph *g2= new TGraph() ;
> gROOT->LoadMacro("SaveData.C");
> timer.Start();
> SaveData(g1,g2) ;
> printf("Temps CPU pour ouvrir l'interface = %f seconds\n",timer.CpuTime());
> }
>
> ------------------------------------------------------------------------
>
> #include <TROOT.h>
> #include <TFile.h>
> #include <TGraph.h>
> #include <TMultiGraph.h>
>
> void SaveData(TGraph *g1, TGraph *g2);
>
> void SaveData(TGraph *g1, TGraph *g2)
> {
>
> TFile *f = new TFile ("test.root", "RECREATE");
> g1->Write("g1");
> g2->Write("g2");
> delete f;
>
> }
>
Received on Tue Feb 20 2007 - 08:55:21 CET

This archive was generated by hypermail 2.2.0 : Tue Feb 20 2007 - 11:50:00 CET