Page 1 of 1

Performance problem

Posted: Thu Mar 25, 2010 1:26 pm
by 9350556
Delphi 2007, TeeChart 7.12:

In my application I use TBarSeries containing more than 10.000 points. A TCursorTool is used as a progress indicator.
It seems that the whole TBarSeries is repainted when the TCursorTool is moved programmatically.
This results in very high CPU use, especially on PC's with single core CPU's.
Even when an assignment like CursorTool.XValue := X; doesn't result in a visible difference (the CursorTool remains at the same X, Y coordinates) the BarSeries is redrawn.

What can I do to reduce CPU load?
Does TeeChart have some options to reduce repainting of the TCursorTool?

Applying some tricks from the page http://www.teechart.net/reference/articles/index.php doesn't make any diffence.

If needed, I can supply a small demonstration program. Otherwise the effect can be seen with Tee7New.exe or Tee8New.exe (Tools -> Cursor -> Synchronizing Two).

Regards,
Bert

Re: Performance problem

Posted: Fri Mar 26, 2010 3:23 pm
by yeray
Hi Bert,

Yes, it would be helpful if you could send us this demo program.
You could also take a look at this thread where something similar has recently been discussed.

Re: Performance problem

Posted: Fri Mar 26, 2010 3:37 pm
by 9350556
Hello Yeray,

The situation in the discussion you mention is different. The cursor is moved programmatically in my application.
Attached you will find a test application with 10.000 values, which is more like a minimum than a maximum in my software.

Regards,
Bert

Re: Performance problem

Posted: Wed Mar 31, 2010 12:39 pm
by yeray
Hi Bert,

Take a look at the attached example. It is a mix between your and GoToXY examples. As you'll see, using custom drawing it doesn't consume as much CPU as the Cursor tool so, is you don't need the features of the tool, I'd recommend you to use custom drawing.

Re: Performance problem

Posted: Tue Apr 06, 2010 8:19 am
by 9350556
Hello Yeray,

Your modification greatly reduces CPU usage.

Thanks for your assistance,
Bert

Re: Performance problem

Posted: Tue Apr 06, 2010 9:44 am
by yeray
Hi Bert,

You are welcome!