RE: TFile effectivity

From: Jakub Čermák <jakub_at_jcermak.cz>
Date: Sun, 8 Nov 2009 16:22:05 +0100


Thanks. Just to be sure - after calling TFile::WriteTObject() I can delete the original object from memory, right? But copy of it still resides in TFile's cache (in RAM memory), or it's written to disk immediately (disregarding OS cache)? If 1st is true, can I force moving the histogram content from memory to disk e.g. with TFile::Flush()?

Why TTree has O(1) random access or write? All balanced trees have O(log n) random access and write. Or is it some other structure?

S pozdravem / Best regards

Jakub Čermák
http://www.jcermak.cz

> -----Original Message-----
> From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]
> On Behalf Of Rene Brun
> Sent: Saturday, November 07, 2009 7:49 AM
> To: Jakub Čermák
> Cc: roottalk_at_cern.ch
> Subject: Re: [ROOT] TFile effectivity
>
> The only thing that TFile keeps in memory is the TKey object (less than
> 100 bytes depending the length of the object name).
> Once you have written your object (histogram) to the file, you can
> delete it from memory.
> You should be able to store millions of objects on the file.
> Note, however, than when you have a very large number of objects to
> write, it is better to
> create a TTtree, where the only object per entry can be a histogram.
> The access time to each object will be faster (direct access) instead
> of
> a log(n) behavior when
> writing them one by one as you do.
>
> Rene Brun
>
> Jakub Čermák wrote:
> > Hello *,
> > I'm writing an app which makes large number of histograms and some
> other graphs and then writes them to TFile. I'd like to avoid holding
> all the objects in memory, because they can be safely written to the
> file and discarded. I destruct all of them as soon as I don't need
> them, but I suppose TFile holds them somewhere in its cache. So the
> question is - is it possible to write a bunch of root objects into a
> file and discard them from memory? So the new histograms will be
> appended at disk to already written ones without need to hold them all
> in memory. I found a Flush function, but I don't know whether it's what
> I need.
> >
> > Thanks
> >
> > Best regards
> >
> > Jakub Čermák
> > http://www.jcermak.cz
> >
> >
> >
Received on Sun Nov 08 2009 - 16:22:23 CET

This archive was generated by hypermail 2.2.0 : Tue Nov 10 2009 - 17:50:03 CET