Page 1 of 2

Speed problems

Posted: Thu Sep 14, 2006 12:40 am
by 9641906
I have several winforms (C#), populated with large fastlines.

THe drawing slows down for each fastline.

With two charts and 6 fastlines on each, the form takes two seconds to respond to an unchecking of a series via the legend - for instance. That should be plenty of time to repaint the whole screen more than 100 times.

I am using the MtxVec library from Dew to draw the series. The "Pixeldownsample" option provided in that library is useless, because it grossly distorts the shape of the graphs. But I don't know whether it's a Dew error or a Steema error. I cannot try the Steema DrawAllPoints = false option. It has not been implemented for indexed series which I am using.

I have experimented with a few of the timesavers mentioned in an earlier thread, but most of them weren't available in my tchart version and the few that were available didn't make any difference.

But from switching between windows it appears that it's the window repainting that is the biggest problem here. The form needs more than two seconds to get back in shape after having been hid behind windows explorer for a moment.

Any good workarounds to this problem?

Posted: Thu Sep 14, 2006 1:44 pm
by Marjan
Hi, Berndt.

Strange. PixelDownSample should work fine i.e. it should reduce the number of displaying points to managable size. Using a simple algorithm PixelDownSample replaces group of points with the same pixel x coordinate with two or four points. But you must be aware of the fact the downsampling is performed on fixed axis/screen scale i.e. PixelDownSample must be called after axis scale changes (when you zoom-in or zoom-out). Alternatively, you can also disable chart zoom and thus guarantee the same plot after PixelDownSample call.

To recap: to get a faster display, you'll have to reduce number of points you're displaying. I think a wrote an article about speeding-up redrawing a while ago. It should be avaiable at our FAQ pages.

Posted: Thu Sep 14, 2006 2:25 pm
by Marjan
Forgot the link to article (sorry):

http://www.teechart.net/reference/modul ... icle&sid=6

The article was originally written for VCL version, but the same principles apply for .NET version as well.

Posted: Thu Sep 14, 2006 3:51 pm
by 9641906
Thanks,

I will study the article.

I think the code is quite OK, but perhaps not for a C# application. I have a Borland application on my PC that reacts much faster and much better in this regard - with almost identical load. So anyone who has a way of improving the c# paint method is very welcome to speak up.

Speed problems 2

Posted: Wed Sep 20, 2006 10:00 am
by 9641906
I've conferred with a .Net expert. I may have to make my own painting method to improve the speed. If I do, it will likely include a separate image layer between the chart and the screen. And use of ClipRectangle.

But whether it's doable and whether it will improve things depends on how TeeChart handles the painting as it is. And the tchart zoom may complicate things. Since I don't have the source code verion it's hard to see what's going on in this regard.

Could you please provide info of how the painting is done and which methods that need to be overridden in order to control the painting from the C# code?

Thanks,

9641906 wrote:I have several winforms (C#), populated with large fastlines.

THe drawing slows down for each fastline.

With two charts and 6 fastlines on each, the form takes two seconds to respond to an unchecking of a series via the legend - for instance. That should be plenty of time to repaint the whole screen more than 100 times.

I am using the MtxVec library from Dew to draw the series. The "Pixeldownsample" option provided in that library is useless, because it grossly distorts the shape of the graphs. But I don't know whether it's a Dew error or a Steema error. I cannot try the Steema DrawAllPoints = false option. It has not been implemented for indexed series which I am using.

I have experimented with a few of the timesavers mentioned in an earlier thread, but most of them weren't available in my tchart version and the few that were available didn't make any difference.

But from switching between windows it appears that it's the window repainting that is the biggest problem here. The form needs more than two seconds to get back in shape after having been hid behind windows explorer for a moment.

Any good workarounds to this problem?

Posted: Wed Sep 20, 2006 10:20 am
by narcis
Hi BerntR,

If you don't have TeeChart for .NET sources you can use Lutz Roeder's .NET Reflector.

You should look at TeeChart assembly, Steema.TeeChart namespace, TChart class and its OnPaint method.

Posted: Wed Sep 20, 2006 12:23 pm
by 9641906
Thanks

Posted: Wed Nov 29, 2006 4:08 pm
by 9346394
We are seeing very slow repaint times as well.
I am sure it has a lot to do with the large amount of data that we are plotting in some instances (several million points) but wanted to see if BerntR had any success with creating his own paint method to improve the repaint speed at all?

We have a custom series class that we derived from the Line series.
I was going to try using a custom class derived from the FastLine series but that class does not give us the Pointer items that we need to have in our series as well.
I am sure the FastLine does not offer that since it is intended to be used for quick line plotting only so it appears that series type will not be an option for us to improve performance.
I looked at the other options in the article about real-time charting and ways to improve performance but some of the options that it suggest to turn off or change the setting on do not appear to exist in the .NET version. I am still looking in to the rest of this article to see if there is anything that I can apply from here that will improve our redraw times.

Initial paint performance for some of our larger plots can be understandably slow but redrawing the plot when nothing should have been changed seems to be taking entirely too long.

Posted: Wed Nov 29, 2006 11:24 pm
by 9641906
I've given up on finding a solution to the slow painting.

I am very disappointed by how the painting is working, but I have choosen to reduce the number of displayed chart series and move on.

But I will be delighted if someone comes up with an improvement.

Posted: Thu Nov 30, 2006 10:05 am
by narcis
Hi Aaron and BerntR,

Currently there's not much we can do to improve performance that's not been said. However, for TeeChart for .NET v3, which is the version we are currently working in, major performance enhancements have been implemented.

We expect to have a TeeChart for .NET v3 Beta version ready before the end of December, so be aware at this forum for further news.

Posted: Thu Nov 30, 2006 1:20 pm
by 9346394
The FastLine series looks pretty decent from the performance point of view but for what we are trying to do, it does not work.

We need to have the ability to display the series as points and/or line and the FastLine series does the line part well enough but gives us no Pointer ability at all.

If there was something like a FastPoint or FastCustomPoint series or even just the ability to use the DrawAllPoints setting on our CustomPoint derived class, I think it would help performance to some extent.

I would be interested to see how the performance improves with the .NET v3 for sure.

Thanks for the replies.

Posted: Thu Nov 30, 2006 2:33 pm
by 9641906
narcis wrote:Hi Aaron and BerntR,

Currently there's not much we can do to improve performance that's not been said. However, for TeeChart for .NET v3, which is the version we are currently working in, major performance enhancements have been implemented.

We expect to have a TeeChart for .NET v3 Beta version ready before the end of December, so be aware at this forum for further news.
Looking forward to it! :)

Posted: Thu Nov 30, 2006 3:29 pm
by narcis
Hi Aaron,

For not drawing all points, have you seen the All Features\Welcome !\Functions\Extended\Reducing number of points example in the features demo? You'll find the demo at TeeChart's program group.

Posted: Thu Nov 30, 2006 3:37 pm
by 9346394
The full licensed version that we currently have is TeeChart Pro v7 for C++ Builder.
The features demo for that version does not appear to contain the item you described (or at least it doesn't seem to be in that location in this demo).
We are in the process of evaluating the trial version of the .NET TeeChart to see if it will meet our needs for a new plotting application that we are thinking about writing in C#.
For right now, I am stuck using the lite version of the current .NET TeeChart so some things will not be available to me but I am getting a good sense of whether or not the .NET version will cover most of our needs.

There are some other function items that we are interested in using but will have to wait to try them out until we make a decision on licensing the full .NET TeeChart.

It is good to know that there is something in the features demo for the latest versions that might address this drawing all points concern. I look forward to trying it out when/if we decide to proceed with the .NET full version.

Thanks.

Posted: Thu Nov 30, 2006 3:43 pm
by narcis
Hi Aaron,

There's also the equivalent example in the VCL version, it is in the same tree path as in the .NET version. Which C++ Builder version are you using?

Also notice that you can download the fully functional evaluation version of TeeChart for .NET v2 so that you can see what you get with the registered version.