Page 1 of 1
Gantt series performance
Posted: Thu Mar 21, 2013 6:26 pm
by 15665264
I have a Gantt series that will ultimately need to display thousands of bars. With only ~600 bars, drawing is taking upwards of 15 seconds.
I just need the Gantt to display simple, plain boxes such as those in the attached image. However, when my entire data set is loaded there will be many thousand of them.
Any suggestions to improve drawing performance? (I'm aware I could do some sort of down sampling, which I will do, but I need better chart performance at least with hundreds of boxes).\
Thanks.
- graph detail.png (5.08 KiB) Viewed 10977 times
Re: Gantt series performance
Posted: Fri Mar 22, 2013 1:12 pm
by 10050769
Hello Jeremy Johnson,
Would be very grateful if you could send us a simple project because we can reproduce exactly your problem here?
Thanks,
Re: Gantt series performance
Posted: Fri Mar 22, 2013 10:13 pm
by 15665264
Code is ready to go. Where shall I send it? Thanks!
Re: Gantt series performance
Posted: Mon Mar 25, 2013 7:59 am
by narcis
Hi Jeremy,
You can either attach it to a forums post or send it to
http://www.steema.net/upload/
Thanks in advance.
Re: Gantt series performance
Posted: Mon Mar 25, 2013 9:42 pm
by 15665264
Thanks, the sample code has been uploaded. (Poor Gantt Performance Test.zip)
Re: Gantt series performance
Posted: Tue Mar 26, 2013 4:06 pm
by 10050769
Hello Jeremy Johnson,
Ok I have achieved improve your performance disabling the PenConnection of Gantt Series. I recommend you, add it after adding values in the gantt as I do in your code:
Code: Select all
// Add many bars to the Gantt series
//this kills performance. i need to support large data sets, and even with down sampling I really would like to get decent performance with thousands of bars.
//
for (int i = 0; i < 500; i++)
{
_activitySeries.Add(startTime.AddSeconds(i * 10), 2, Colors.Red);
}
_activitySeries.Add(startTime.AddSeconds(iOffPanelStart * secBetweenTicks), startTime.AddSeconds(iAbsentStart * secBetweenTicks), 1, _color2);
_activitySeries.Add(startTime.AddSeconds(iAbsentStart * secBetweenTicks), startTime.AddSeconds(iAbsentEnd * secBetweenTicks), 0, _color3);
_activitySeries.ConnectingPen.Visible = false;
Could you tell us if it works in your end?
I hope will helps.
Thanks,
Re: Gantt series performance
Posted: Wed Apr 03, 2013 3:49 pm
by 15665264
Thanks! This has improved execution time tremendously.
However, the memory usage by the Gantt series is huge. With more than around 12000 items, I get an out-of-memory exception. Memory usage in my sample app is around 850MB with 10000 items.
Is there anything that can be done to reduce memory usage?
Thanks,
Jeremy
Re: Gantt series performance
Posted: Fri Apr 05, 2013 11:07 am
by 10050769
Hello Jeremy,
Ok, I have made a simple modification that consist in add start and end coordinates and color, therefore, use correctly method add of Gantt series. Please see in the attached project the modification code and check if performance is improved and out-of-memory exception disappears in your machine. If you have any problems please let me know.
Thanks,
Re: Gantt series performance
Posted: Fri Apr 05, 2013 3:21 pm
by 15665264
Thanks, Sandra! You've saved the day.
Memory usage is now a slim 50MB for 10,000 items.