Re: [ROOT] TGraph::SetPoint performance

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Sep 02 2004 - 16:23:15 MEST


Hi Maxim,

In the CVS version, I have improved the array reallocation mechanism
for TGraph, TGraphErrors, TGraphAsymmErrors and TGraphBentErrors.
I hope that you see an improvement. Let me know.

Rene Brun

Maxim Nikulin wrote:
> 
> Hi,
> 
> I'm writing a kind of slow control system. I use several histograms, two
> dimensional plots and TGTextView widgets. They should be "ready to
> display". If program receives entries one by one it works fine, but
> reading a file recorded early takes significant time.
> 
> Using the callgrind program I found several poor places. The first one
> was TGTextView::AddLine() (Posted in
> http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk04/2536.html
> and fixed). Than my manipulations with TAxis::SetTimeDisplay() became
> most important (old post, for curiosity only
> http://root.cern.ch/phpBB2/viewtopic.php?t=992 ) and I found more cheap
> workaround.
> 
> For two dimensional plots I use the TGraph class. When the program
> receives an entry it calls TGraph::SetPoint(). This leads to allocation,
> copying and deallocation of x and y arrays. I don't use TGraph::Set() to
> allocate large buffer due to (0, 0) points appear on my plots.
> 
> I propose to introduce additional member and split point number and
> array size for the TGraph suite. Are there any arguments against the
> solution? I checked it with restricted descendant of TGraph, but in
> general case it is more complicated than the TGTextView::AddLine()
> issue, that's why I decide to discuss it firstly.
> 
> --
> Max



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET