speed problems

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
inomed
Newbie
Newbie
Posts: 2
Joined: Mon Apr 23, 2007 12:00 am

speed problems

Post by inomed » Mon May 07, 2007 3:06 pm

Hello,

I am developing a medical application which _must_ update the collected data at least every 50ms, 40ms would be appreciated.

At the moment I made an approach using FastLine series. The data is gathered in a second thread and fast enough, so the main-thread (GUI) only has to refresh the screen and handle user requests. The target platform _must_ be a VIA Eden CPU with 1200MHz, on which the application performs very badly.

Displaying 1000 datapoints without using 100% CPU is only possible with 150ms or higher refresh rates, sampling down the number of points doesn't gain much speed, i.e. reducing the number of points to 100 or even to 10 points.

I can mention that I did everything that is suggested in this article http://www.teechart.net/reference/modul ... icle&sid=6.

What are your experiences with minimum refresh rates on a "weak" system like that? What else can I do to speed up the refresh of the series?

Best regards


Mathias

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon May 07, 2007 3:18 pm

Hi Mathias,

Maybe using asynchronous painting technique, using AutoRepaint property as suggested in the threads below, may help enhancing your system's performance.

http://www.teechart.net/support/viewtopic.php?t=5315
http://www.teechart.net/support/viewtopic.php?t=5127

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

inomed
Newbie
Newbie
Posts: 2
Joined: Mon Apr 23, 2007 12:00 am

Post by inomed » Mon May 07, 2007 4:08 pm

Hello Narcis,

thank you for the reply. Autorepaint=false is already set, the series is only repainted, when an interval x ms is elapsed, not every time data was added.

I get the same bad performance if I make a simple sample project with a timer which repeatedly generates 100-1000 random values, adds them to the series and calls series.Repaint().

Therefore, I think I can be sure, that it's not a problem that the "refresh"-thread doesn't have enough processor cycles to do refreshing.

The second requested forum thread deals with a slightly different problem, i.e. it's not the problem that the series isn't repainted, it's too slow repainted, in my case.

The more interesting question is: how fast can TChart series update? Isn't it possible to display about 1000 points every 40ms on an x86-CPU with 1200MHz?

Best regards


Mathias

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed May 09, 2007 2:31 pm

Hi Mathias,

Thanks for the information.

I've been doing some tests here using the slowest machine I found. It's a Dell Inspiron 7500 laptop with a Pentium III CPU at 650 MHz and 256 MB RAM.

The code I used is this:

Code: Select all

		private void timer1_Tick(object sender, System.EventArgs e)
		{
			if (fastLine1.Count > 100000) fastLine1.Delete(0,1000);

			Random y = new Random();
			
			for (int i=0; i<1000; ++i)
			{
				fastLine1.Add(y.Next());
			}

			tChart1.Refresh();
		}
		
		private DateTime startTime, now;

		private void tChart1_BeforeDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			startTime = DateTime.Now;
		}

		private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			//calculate elapsed time         
			now = DateTime.Now;
			TimeSpan elapsedTime = new TimeSpan(now.Ticks - startTime.Ticks);
			int total = (elapsedTime.Seconds * 1000) + elapsedTime.Milliseconds;
         
			label1.Text="Elapsed time: " + total.ToString() + " ms";
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			timer1.Enabled = !timer1.Enabled;
		}

		private void Form1_Load(object sender, System.EventArgs e)
		{
			tChart1.Aspect.ClipPoints = false;
			tChart1.Header.Visible = false;
			tChart1.Legend.Visible = false;
			tChart1.Axes.Left.AxisPen.Width = 1;
			tChart1.Axes.Bottom.AxisPen.Width = 1;
			tChart1.Axes.Bottom.Labels.RoundFirstLabel = false;
			tChart1.Aspect.View3D = false;
			tChart1.AutoRepaint = false;
			
			fastLine1.AutoRepaint = false;
			fastLine1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None;
		}
When 100000 points were on the chart, the laptop took around 3000 milliseconds repainting each timer tick. Please notice the timer was set to 40 ms and the application was compiled in release mode.

The same application running in a Pentium IV at 3,2 GHz with 2GB RAM took about 1400 milliseconds when refreshing 100000 points.

Could you please test this code at your end and let us know how it goes?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply