Big problems with big numbers

5 posts, 0 answers
  1. Marcus
    Marcus avatar
    3 posts
    Member since:
    Apr 2009

    Posted 17 Apr 2009 Link to this post

    I'm binding a simple line chart to 8 points. When the X values of the points are around 10,000, there's no problem. When the values are around 100,000, there's a slight delay (~1 second on my box). Increasing the values to around 1,000,000 results in a ~12 second delay. Going higher increases the delay proportionately. Anything I can do to prevent this (other than dividing my values by 1,000)?
  2. Marcus
    Marcus avatar
    3 posts
    Member since:
    Apr 2009

    Posted 17 Apr 2009 Link to this post

    I've found the cause of the problem. It has to do with using an ObservableCollection. When items are added to the collection that have large numbers, the performance dies. Here's some code to reproduce:

     
        public partial class TestPage : UserControl 
        { 
            public TestPage() 
            { 
                InitializeComponent(); 
     
                ObservableCollection<TestObject> TestObjectCollection = new ObservableCollection<TestObject>(); 
     
                SeriesMapping SeriesMapping1 = new SeriesMapping(); 
                SeriesMapping1.ItemMappings.Add(new ItemMapping("TestValue", DataPointMember.YValue)); 
                SeriesMapping1.SeriesDefinition = new LineSeriesDefinition(); 
                TestChart.SeriesMappings.Add(SeriesMapping1); 
                TestChart.ItemsSource = TestObjectCollection; 
     
                // This works just fine: 
                TestObjectCollection.Add(new TestObject() { TestValue = 10000 }); 
                TestObjectCollection.Add(new TestObject() { TestValue = 20000 }); 
                TestObjectCollection.Add(new TestObject() { TestValue = 30000 }); 
     
                // This takes a while to render: 
                /*
                TestObjectCollection.Add(new TestObject() { TestValue = 10000000 });
                TestObjectCollection.Add(new TestObject() { TestValue = 20000000 });
                TestObjectCollection.Add(new TestObject() { TestValue = 30000000 });
                */ 
            } 
        } 
     
        public class TestObject 
        { 
            public double TestValue { getset; } 
        } 

    This appears to afflict Lists as well, but not nearly as badly. The best work-around I've found is to bind to a List and display your results in millions (so you're binding to 1.35 instead of 1,350,000, for example).

    Another symptom I found was that a StackedBarSeries would fail to render at all (other types of Series rendered fine after the delay), in case anyone else runs into this problem.
  3. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 21 Apr 2009 Link to this post

    Hello Marcus,

    Thanks for notifying us about these issues. Our developers are already investigating them so that the fix is included in the next release of the control. Your Telerik points have been updated.

    Best regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  4. Brandon Zeider
    Brandon Zeider avatar
    4 posts
    Member since:
    Jun 2008

    Posted 24 Aug 2009 Link to this post

    Has this issue been resolved?
  5. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 26 Aug 2009 Link to this post

    Hi Brandon,

    Yes, this has been fixed. Please, check the latest version - 2009 Q2 SP1.

    Regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top