[ROOT] Re: CINT cpu speed?

From: Arthur E. Snyder (snyder@SLAC.stanford.edu)
Date: Tue Jan 28 2003 - 23:41:11 MET


see attached test

A.E. Snyder, Group EC                        \!c*p?/
SLAC Mail Stop #95                          ((.   .))
Box 4349                                        |
Stanford, Ca, USA, 94309                      '\|/`
e-mail:snyder@slac.stanford.edu                 o
phone:650-926-2701                              _
http://www.slac.stanford.edu/~snyder          BaBar
FAX:650-926-2657                          Collaboration



On Tue, 28 Jan 2003, Rene Brun wrote:

> Art,
>
> Could you run the script below on your machine with your latest Root with:
>  root > gROOT.Time()
>  root > .x art.C
>  root > .x art.C+
>  root > .x art.C+
>
> and send me the times
>
> Rene Brun
>
> //--------file art.C
> #include "TNtuple.h"
> #include <fstream>
>
>  //ASCII tuple reader:
>
>  TNtuple* art() {
>  ifstream fp("pion-1.612.tuples");
>
>  TNtuple* temp=new TNtuple("ntuple","ascii
>  data","evtno:npievt:status:idmom:eve:ideve:b:idb:xb:yb:zb:
>  xeve:yeve:zeve:pxpimc:pypimc:pzpimc:ptpimc:ppimc:thpimc:
>  phipimc:pxpirc:pypirc:pzpirc:ptpirc:ppirc:thpirc:phipirc:
>  xpirc:ypirc:zpirc:nsvtpi:ndchpi:lenpi:delth:delthalt:pxalt:
>  pyalt:pzalt:thalt:phialt:xalt:yalt:zalt:pxmom:pymom:pzmom:
>  ptmom:pmom:thmom:phimom:xmom:ymom:zmom:idpimom:idpigma");
>
>  Float_t array[56];
>  Int_t loop=1;
>  Int_t count=0;
>
>  while(loop) {
>   for(Int_t i=0; i<56; i++) {
>  fp >> array[i];
>   }
>  temp->Fill(array);
>  count++;
>  if(count>=16434) break;
>  if(count%1000==1) printf("count: %d \n",count);
>  }
>
>  printf("total: %d \n ",count);
>  return temp;
>  }
>
>
>
> "Arthur E. Snyder" wrote:
> >
> > I ran it on the same file on the same machine with the two different root
> > versions, so the only thing different was the root version. The times I got
> > with the   faster, older version were about the same as your seeing.
> >
> > -Art
> >
> > ----- Original Message -----
> > From: "Rene Brun" <Rene.Brun@cern.ch>
> > To: "Arthur E. Snyder" <snyder@SLAC.Stanford.EDU>
> > Cc: <roottalk@pcroot.cern.ch>
> > Sent: Tuesday, January 28, 2003 7:25 AM
> > Subject: Re: CINT cpu speed?
> >
> > > Art,
> > >
> > > I have run your script on your file
> > >  - with CINT      : Real time 0:00:04, CP time 4.280
> > >  - with ACLIC/gcc : Real time 0:00:04, CP time 3.590
> > >
> > > As you can see, CINT is extremely fast and your factor 2 or 10!
> > > must be somewhere else. Is your file somewhere on a slow server?
> > >
> > > Rene Brun
> > >
> > > "Arthur E. Snyder" wrote:
> > > >
> > > > The factor of 10 is very odd. I'm just using standard root executables
> > > > at SLAC. I haven't recompiled it our anything, so I assume they are
> > > > optimized to the same level.
> > > >
> > > > I'll send you the file.
> > > >
> > > > ----- Original Message -----
> > > > From: "Rene Brun" <Rene.Brun@cern.ch>
> > > > To: "Arthur E. Snyder" <snyder@SLAC.Stanford.EDU>
> > > > Cc: <roottalk@pcroot.cern.ch>
> > > > Sent: Tuesday, January 28, 2003 5:57 AM
> > > > Subject: Re: CINT cpu speed?
> > > >
> > > > > Art,
> > > > >
> > > > > I do not understand this factor 10. Are you sure than you run
> > > > > with the same CINT optimisation level in both cases?
> > > > > Could you send me your file pion-1.612.tuples?
> > > > >
> > > > > Rene Brun
> > > > >
> > > > > "Arthur E. Snyder" wrote:
> > > > > >
> > > > > > I find speed of C++ interpreter to be much slower in new versions of
> > > > root
> > > > > > than in old ones. Using the code attached below to read in an ASCII
> > file
> > > > I
> > > > > > find a factor of 2 decrease in the speed of the macro between
> > 3.02-07
> > > > > > and  2.23-12. Why is that? This not progress!
> > > > > >
> > > > > > Even stranger is that the original version of this code which used
> > > > "cout"
> > > > > > rather than "printf" to print out variable "count" is even slower.
> > That
> > > > > > one ran 10x slower in 3.02-07 than 2.23-12 the 1st time it was
> > executed,
> > > > > > but improved to only 2x slower when executed again. I'm not sure if
> > this
> > > > > > really had anything to do with use of "cout <<" instead of  printf,
> > > > since
> > > > > > other minor changes such as putting in a few statements to print cpu
> > > > time
> > > > > > used also produced improvement from 10x worse to only 2x worse.
> > > > > >
> > > > > > Anybody have any idea what's going on here?
> > > > > >
> > > > > > -Art Snyder, SLAC
> > > > > >
> > > > > > ASCII tuple reader:
> > > > > >
> > > > > > TNtuple* readASCII() {
> > > > > > ifstream fp("paw/pion-1.612.tuples");
> > > > > >
> > > > > > TNtuple* temp=new TNtuple("ntuple","ascii
> > > > > > data","evtno:npievt:status:idmom:eve:ideve:b:idb:xb:yb:zb:
> > > > > > xeve:yeve:zeve:pxpimc:pypimc:pzpimc:ptpimc:ppimc:thpimc:
> > > > > > phipimc:pxpirc:pypirc:pzpirc:ptpirc:ppirc:thpirc:phipirc:
> > > > > > xpirc:ypirc:zpirc:nsvtpi:ndchpi:lenpi:delth:delthalt:pxalt:
> > > > > > pyalt:pzalt:thalt:phialt:xalt:yalt:zalt:pxmom:pymom:pzmom:
> > > > > > ptmom:pmom:thmom:phimom:xmom:ymom:zmom:idpimom:idpigma");
> > > > > >
> > > > > > Float_t array[56];
> > > > > > Int_t loop=1;
> > > > > > Int_t count=0;
> > > > > >
> > > > > > while(loop) {
> > > > > >  for(Int_t i=0; i<56; i++) {
> > > > > > fp >> array[i];
> > > > > >  }
> > > > > > temp->Fill(array);
> > > > > > count++;
> > > > > > if(count>=16434) break;
> > > > > > if(count%1000==1) printf("count: %d \n",count);
> > > > > > }
> > > > > >
> > > > > > printf("total: %d \n ",count);
> > > > > > return temp;
> > > > > > }
> > > > > >
> > > > > > A.E. Snyder, Group EC                        \!c*p?/
> > > > > > SLAC Mail Stop #95                          ((.   .))
> > > > > > Box 4349                                        |
> > > > > > Stanford, Ca, USA, 94309                      '\|/`
> > > > > > e-mail:snyder@slac.stanford.edu                 o
> > > > > > phone:650-926-2701                              _
> > > > > > http://www.slac.stanford.edu/~snyder          BaBar
> > > > > > FAX:650-926-2657                          Collaboration
>





This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:08 MET