Slow chartmap template load

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Hermes
Newbie
Newbie
Posts: 33
Joined: Fri Feb 03, 2012 12:00 am

Slow chartmap template load

Post by Hermes » Fri Aug 03, 2012 2:11 pm

Once I save a template from a chartmap, when I load it it takes too long.

In the attached sample, there are two charts and two textbox.
The first chart is generated from a shp file and the first textbox shows the time taken to load it.
The second chart is generated from the saved template of the first one and second textbox shows the time taken to load it.

The results I found here were:
Time to load from shp: 74.0042 (milliseconds)
Time to load from stream: 5231.2992 (milliseconds)

Is this fine? Am I doing something wrong? Why is it so different? We are having serious performance problems because of this and would appreciate any help.

I wasn't able to upload the shp file because of its file size, is there any alternative so you can test this with same shp?

Thanks!
Attachments
Sample.zip
(3.79 KiB) Downloaded 712 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Slow chartmap template load

Post by Sandra » Mon Aug 06, 2012 3:19 pm

Hello Hermes,

You can upload your project in the upload page. On the other hand, I can try to reproduce your problem using your code and it doesn't compile for me. Please, try to arrange a simple project that we can run "as-is" here, because we can reproduce your problem.

Thanks,
Best Regards,
Sandra Pazos / 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

Hermes
Newbie
Newbie
Posts: 33
Joined: Fri Feb 03, 2012 12:00 am

Re: Slow chartmap template load

Post by Hermes » Thu Aug 09, 2012 2:58 pm

I uploaded TeeChartMap.zip with name Johann and mail [email protected] (I guess that's how you can identify the file as it didn't return any other identifier).

The content of the file is a VS2010 web project with the page described before and the shp file used.

I will gladly give you any other information you need.

Thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Slow chartmap template load

Post by Sandra » Fri Aug 10, 2012 11:10 am

Hello Hermes,

Thanks for your project, we can reproduce your problem here and we are working to find an answer for this behavior.

Thanks,
Best Regards,
Sandra Pazos / 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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Slow chartmap template load

Post by Sandra » Mon Aug 13, 2012 3:02 pm

Hello Hermes,

We have made a solution for you, where increase the performance of your application. We have done three modifications that change the performances of your webChart.
1.- Not include data: WebChart1.Chart.Export.Template.IncludeData = false;
2.- Add the Shapes of Map in the PolygonList: Steema.TeeChart.Styles.PolygonList pList = lMapa.Shapes;
3.- Add the Shapes you have saved in pList to the Series of WebChart2: ((Map)(WebChart2.Chart.Series[0])).Shapes = pList;

You can test it using next code:

Code: Select all

protected void Page_Load(object sender, EventArgs e)
    {

        DateTime lTime = DateTime.Now;
        TeeSHP lTeeSHP = new TeeSHP(@"J:\Sandra\brossa\TeeChartMap\TeeChartMap\");
        Map lMapa = new Map();
        WebChart1.Chart.Series.Add(lMapa);
        //Steema.TeeChart.Styles.Line line = new Line(WebChart1.Chart);
        //line.FillSampleValues();
        WebChart1.TempChart = Steema.TeeChart.Web.TempChartStyle.Session;
        lTeeSHP.LoadMap(lMapa, "southamerica_adm0.shp");
        TextBox1.Text = (DateTime.Now - lTime).TotalMilliseconds.ToString();
        WebChart2.Chart.AutoRepaint = false;
        var lStream = new MemoryStream();

        WebChart1.Chart.Export.Template.IncludeData = false;
        WebChart1.Chart.Export.Template.Save(lStream);

        Steema.TeeChart.Styles.PolygonList pList = lMapa.Shapes;

        lStream.Position = 0;
        lTime = DateTime.Now;
        WebChart2.Chart.Import.Template.Load(lStream);

        ((Map)(WebChart2.Chart.Series[0])).Shapes = pList;

        WebChart2.TempChart = Steema.TeeChart.Web.TempChartStyle.Session;
        TextBox2.Text = (DateTime.Now - lTime).TotalMilliseconds.ToString();
    }
Can you tell us if previous code improve your performance? On the other hand, you need know we have a problem with serialization and WebChart. We are working to fix it for upcoming versions of TeeChartFor.Net.

Thanks,
Best Regards,
Sandra Pazos / 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

Hermes
Newbie
Newbie
Posts: 33
Joined: Fri Feb 03, 2012 12:00 am

Re: Slow chartmap template load

Post by Hermes » Tue Sep 04, 2012 5:04 pm

As this serialization is part of a bigger code where lots of other controls are being serialized this solution is not adecuate for us. Have you had any progress on fixing the issue?

Thanks!

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Slow chartmap template load

Post by Sandra » Wed Sep 05, 2012 9:12 am

Hello Hermes,

We were looking to include elements of the test solution we sent you into the TeeChart product itself. From a performance point of view your feedback would be useful to help us understand if we are reaching the objective in that respect.

Thanks,
Best Regards,
Sandra Pazos / 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

Hermes
Newbie
Newbie
Posts: 33
Joined: Fri Feb 03, 2012 12:00 am

Re: Slow chartmap template load

Post by Hermes » Mon Sep 10, 2012 11:23 am

Our expectation is that the time it takes to load the chart from the stream is in the same order as it takes to loading it in the first time from the shp. I guess, taking the sample into account, that 70,100 or 200 ms would be acceptable.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Slow chartmap template load

Post by Sandra » Fri Sep 14, 2012 10:32 am

Hello Hermes,

Sorry for the delay. We are adding our workaround in the source code and it already be implemented in next maintenance release of TeeChartFor.Net. I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.

Thanks,
Best Regards,
Sandra Pazos / 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

Hermes
Newbie
Newbie
Posts: 33
Joined: Fri Feb 03, 2012 12:00 am

Re: Slow chartmap template load

Post by Hermes » Tue Sep 18, 2012 1:27 pm

Thanks! Is there an approximate date when this will be available?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Slow chartmap template load

Post by Sandra » Tue Sep 18, 2012 2:36 pm

Hello Hermes,

The next maintenance release would be published in few weeks, but I can not provide you the concretly date. I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.

Thanks,
Best Regards,
Sandra Pazos / 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

Hermes
Newbie
Newbie
Posts: 33
Joined: Fri Feb 03, 2012 12:00 am

Re: Slow chartmap template load

Post by Hermes » Wed Oct 10, 2012 5:45 pm

Was a solution for this included in the newest release 4.1.2012.09280? I cannot find it in the documentation.

thank you

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

Re: Slow chartmap template load

Post by Narcís » Thu Oct 11, 2012 9:20 am

Hi Hermes,

According to what Sandra posted here I'd assume that this has been included even not documented. Have you tried if the new version solves the problem at your end?

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

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

Re: Slow chartmap template load

Post by Narcís » Thu Oct 11, 2012 11:53 am

Hi Hermes,

As an update, I can confirm that the solution has been implemented in the current version. You should set IncludeData=false as in the example below:

Code: Select all

    protected void Page_Load(object sender, EventArgs e)
        {
                DateTime lTime = DateTime.Now;

                TeeSHP lTeeSHP = new TeeSHP(@"C:\Users\Christopher Ireland\Downloads\TeeChartMap\TeeChartMap\");
                Map lMapa = new Map();
                //lMapa.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Value;
                //lMapa.Marks.Visible = true;
                WebChart1.Chart.Series.Add(lMapa);
                WebChart1.TempChart =
Steema.TeeChart.Web.TempChartStyle.Session;
                lTeeSHP.LoadMap(lMapa, "southamerica_adm0.shp");
                TextBox1.Text = (DateTime.Now - lTime).TotalMilliseconds.ToString();

                var lStream = new MemoryStream();
                WebChart1.Chart.Export.Template.IncludeData = false;
                WebChart1.Chart.Export.Template.Save(lStream);
                lStream.Position = 0;
                lTime = DateTime.Now;
                WebChart2.Chart.Import.Template.Load(lStream);
                lMapa = WebChart2.Chart[0] as Map;
                lTeeSHP.LoadMap(lMapa, "southamerica_adm0.shp");
                WebChart2.TempChart =
Steema.TeeChart.Web.TempChartStyle.Session;
                TextBox2.Text = (DateTime.Now - lTime).TotalMilliseconds.ToString();
        }
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

Hermes
Newbie
Newbie
Posts: 33
Joined: Fri Feb 03, 2012 12:00 am

Re: Slow chartmap template load

Post by Hermes » Fri Oct 12, 2012 7:49 pm

As I had said before, my solution need to serialize the chart WITH the data. For it, IncludeData = false it is not a solution for me. Have you any plan to optimize this or add a method to serialize and deserialize to a stream the hole control?

thanks

Post Reply