Re: TMapFile, TFile - discussive

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Tue Jul 14 1998 - 21:20:18 MEST


Hi Valeriy,

   the default TBuffer allocation size is 1024 bytes. I've
changed it to 128 for TMapFile (for objects bigger than 128
the buffer is anyway automatically expanded).

In some later stage we could add locking to TFile to allow
concurrent operations. Still the advantage of the TMapFile
is that the simple directory structure does not have to
be reread all the time (as would be required for TFile).

Cheers, Fons.


> 
> 1.
>   For my opinion the main obstacles of using
> TMapFiles is unoptimized memory allocation
> see macro example below
> 
> root [0]  mfile = TMapFile::Create("test.map","NEW", 100000," ")
> (class TMapFile*)0x0
> root [1] TNamed* dummy1 = new
> TNamed("dummy1","dummy1")
> root [2] dummy1->AppendDirectory()
> root [3] dummy1->Sizeof()
> (Int_t)14
> root [4]  mfile->Update();
> root [5]  mfile->ls();
> Object               Class                Size
> dummy1               TNamed               1024
> root [6] TNamed* dummy2 = new TNamed("dummy2","dummy2")
> root [7] dummy2->AppendDirectory()
> root [8]  mfile->Update();
> root [9]  mfile->ls();
> Object               Class                Size
> dummy1               TNamed               1024
> dummy2               TNamed               1024
> 
> -- even tiny objects like dummy1,dummy2 allocate 1kb memory each.
> 
> Could it be improved or where I'm wrong?
> 
> 2.
>   I'd like to share dynamic data between two processes via TFile,
> after having new feature of TObject::Write()
> (see http://root.cern.ch/root/roottalk/roottalk98/1238.html)
>  it seems to be possible in a way similar to TMapFile::Update()/Get()
> 
> One of the problems remained is sincronization.
> 
> Could it be implemmented as embbeded feature  or as one of the options
>  of TObject::Read/Write  like it is done in TMapFile::Update/Get?
> 
> 
>                         With best regards,        Valeriy

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:35 MET