Re: [ROOT] drawing speed in online monitoring

From: Damir Buskulic (buskulic@lapp.in2p3.fr)
Date: Fri Feb 16 2001 - 19:01:37 MET


Hi Rene, Fons, Eddy,

Indeed, I'm seeing the problem with large (10000-20000) number of bins,
not so much with small histograms. And just before Eddy's mail, I was
thinking that it would be nice to implement his algorithm ! Since it is
done, it's fine. What is the size at which the algorithm begins to do
it's job ?
For what concerns fons's suggestions, I did them and this is clearly not
the main problem, since I was already not using the TTF fonts.

Thanks anyway for your suggestions. I'll try to squeeze a little bit
more from my code but I'm afraid I can't do much.

Damir

Rene Brun wrote:
> 
> Hi Eddy,
> I do not think that Damir is using histograms with a large number of bins
> in this example. So your algorithm is not faulty. By the way, your algorithm
> is there to gain and not loose time. Damir's problems, as mentioned by Fons,
> are connected with the fonts.
> 
> Rene
> 
> Eddy Offermann wrote:
> >
> > Hi Damir,
> >
> > I guess I am responsible for the effects you are seeing.
> > Around version 2.23 I submitted a change to the drawing engine.
> > Before the change the drawing speed was canvas size independ, it would have
> > taken 14 sec in both of your cases.
> > I made the algorithm smarter. If you draw your histogram with a simple
> > line, it decides whether draw it in low or high res mode. In low-res mode,
> > it first looks up the number of pixels
> > of your canvas in the horizontal direction. Then, for each pixel it will
> > calculate the minimum and maximum vertical pixel and will then draw a vertical
> > line connecting them, obviously saving a lot of time when the canvas is
> > smaller
> >
> > for details look in TGraph.cxx and serach for the following lines
> >
> >     // Make here decision whether it should be painted in high or low resolution
> >     Int_t lowRes = 0;
> >
> > Here the algorith starts.
> >
> > I thought it was the best kept secret in ROOT, oh well you find out :-}
> >
> > Eddy
> >
> > > X-Authentication-Warning: pcroot.cern.ch: majordomo set sender to
> > owner-roottalk@root.cern.ch using -f
> > > Date: Fri, 16 Feb 2001 15:04:23 +0100
> > > From: Damir Buskulic <buskulic@lapp.in2p3.fr>
> > > X-Accept-Language: en
> > > MIME-Version: 1.0
> > > To: roottalk@pcroot.cern.ch
> > > Subject: [ROOT] drawing speed in online monitoring
> > > Content-Transfer-Encoding: 7bit
> > > X-Filter-Version: 1.3 (wren)
> > >
> > > Hi,
> > >
> > > There was a thread a few months ago about drawing speed of ROOT. I'm
> > > trying to replace PAW routines by ROOT ones in an online data display
> > > program. The main observed difference is the drawing speed in the case
> > > of ROOT, which is much slower than PAW. While I can understand this (a
> > > factor of two in the best case) it is difficult to understand the
> > > variation of drawing speed with the canvas size. Try the following macro
> > > :
> > >
> > > {
> > >   gBenchmark->Start("toto");
> > >   c1 = new TCanvas("c1","test",10,10,700,700);
> > >   h = new TH1F("h","h",1000,0,10);
> > >   for (int i=1;i<100;i++) {
> > >      h->Fill(gRandom->Gaus(5,1.5),1);
> > >      h->Draw();
> > >      gPad->Update();
> > >   }
> > >   gBenchmark->Show("toto");
> > > }
> > >
> > > on my machine this needs around 14 s real time to be completed (Alpha
> > > XP1000).
> > > change the size of the canvas to 50x50 (not usable, it's just for
> > > demonstrating the effect), the real time goes down to 2.8s !
> > >
> > > Though fons explained the speed difference between PAW and ROOT, he
> > > stated that the drawing speed should not depend much on the canvas size.
> > > This is true for CPU time but not for real time.
> > >
> > > I also tested on a distant display, and the results are the same (14s
> > > and 3s).
> > >
> > > In our context, and if this figure cannot be changed, I don't see yet
> > > how to use root to display in real time a set of 10 histograms or plots.
> > >
> > > Anyone has a suggestion ? it will be welcome !
> > >
> > > Cheers
> > >
> > > Damir
> > > --
> > > =====================================================================
> > > | Damir Buskulic                  | Universite de Savoie/LAPP       |
> > > |                                 | Chemin de Bellevue, B.P. 110    |
> > > | Tel : +33 (0)450091600          | F-74941 Annecy-le-Vieux Cedex   |
> > > | e-mail: buskulic@lapp.in2p3.fr  | FRANCE                          |
> > > =====================================================================
> > > mailto:buskulic@lapp.in2p3.fr
> >
> > Eddy A.J.M. Offermann
> > Renaissance Technologies Corp.
> > Route 25A, East Setauket NY 11733
> > e-mail: eddy@rentec.com
> > http://www.rentec.com

-- 
=====================================================================
| Damir Buskulic                  | Universite de Savoie/LAPP       |
|                                 | Chemin de Bellevue, B.P. 110    |
| Tel : +33 (0)450091600          | F-74941 Annecy-le-Vieux Cedex   |
| e-mail: buskulic@lapp.in2p3.fr  | FRANCE                          |
=====================================================================
mailto:buskulic@lapp.in2p3.fr



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:36 MET