Re: automatic Streamer

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Wed, 8 Jun 2005 18:10:33 +0200 (MEST)


Hi Gerhard,

I have run a small test with the class shown below (see file A.h). I do not see any difference in time between the old-style Streamers and the new recommended Streamer. This is very good. We try to discourage by all means users to use the old Streamer style. The old Streamers do not support the complex C++ classes supported by the new Streamer.
They do not support the automatic schema evolution.

Note that when a class is used with a Tree in split mode (typical case), the case is irrelevant because in this case objects are Streamed memberwise and the Streamer function is not used. However, internally the split mode is based on the new Streamer algorithm using the info in the class dictionary.

Rene

#include "TObject.h"

class A : public TObject {

    Int_t   fInt0;
    Int_t   fInt1;
    Int_t   fInt2;
    Int_t   fInt3;
    Int_t   fInt4;
    Int_t   fInt5;
    Int_t   fInt6;
    Int_t   fInt7;
    Int_t   fInt8;
    Int_t   fInt9;
    Float_t fFloat0;
    Float_t fFloat1;
    Float_t fFloat2;
    Float_t fFloat3;
    Float_t fFloat4;
    Float_t fFloat5;
    Float_t fFloat6;
    Float_t fFloat7;

    Float_t fFloat8;
    Float_t fFloat9;

public:

    A();
    virtual ~A() {;}
    void Set(Int_t i);

    ClassDef(A,1)
};
On
Wed,
8 Jun 2005, Gerhard Brandt wrote:

> Rene Brun wrote:
>> Hi gero,
>>
>> yes, you understood my point correctly. The new Streamer is more efficient
>> than the old one when it finds consecutive data members
>> of the same type.
>
> Hi Rene,
>
> Can you quantify 'faster' and 'more efficient'?
> Are there some test results?
>
> Thanks,
> Gerhard
>
>
>> Rene Brun
>>
>> On Wed, 8 Jun 2005, Gero Flucke wrote:
>>
>>> On Tue, 7 Jun 2005, Rene Brun wrote:
>>>
>>>> Hi Gero,
>>>>
>>>> If you have consecutive data members of the same type, the automatic
>>>> Streamer is faster.
>>>> In addition, the automatic schema evolution is only available with
>>>> the automatic Streamers.
>>>> We STRONGLY recommend to use the automatic Streamers.
>>>
>>>
>>> Hi Rene,
>>> thanks for explanation, just for being sure that I understand you
>>> correctly:
>>> By 'consecutive data members of the same type' you mean that class data
>>> members are ordered by their type, e.g.
>>>
>>> class MyClass : public TObject{
>>> Float_t fFloat1;
>>> Float_t fFloat2;
>>> Int_t fInt;
>>>
>>> ClassDef(MyClass)
>>> }
>>>
>>> is (with 'new' Streamer) better than
>>>
>>> class MyClass : public TObject{
>>> Float_t fFloat1;
>>> Int_t fInt;
>>> Float_t fFloat2;
>>>
>>> ClassDef(MyClass)
>>> }
>>>
>>> Am I right?
>>>
>>> Cheers
>>>
>>> Gero
>>>
>>>> On Tue, 7 Jun 2005, Gero Flucke wrote:
>>>>
>>>>> Hi,
>>>>> is there a general rule which automatically generated streamer mechansim
>>>>> is faster:
>>>>> The (very) old one or the "new" introduced in ROOT 3.0 and activated if
>>>>> I
>>>>> have in my LinkDef.h
>>>>>
>>>>> #pragma link C++ class MyClass+;
>>>>>
>>>>> with the '+' in the end.
>>>>>
>>>>> Cheers
>>>>>
>>>>> Gero
>>>
>>>
>>> --
>>> -----------------------------------------------------------------------
>>> Gero Flucke
>>> 1a / 603
>>> DESY
>>> Notkestr. 85
>>> 22607 Hamburg
>>> +49-(0)40-8998-2454
>>>
>>
>
Received on Wed Jun 08 2005 - 18:10:39 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:09 MET