Deteriorating performance with increasind number of properties

8 posts, 0 answers
  1. Weicong
    Weicong avatar
    4 posts
    Member since:
    Jun 2012

    Posted 16 Dec 2013 Link to this post

    We have a single Property grid with around 83 properties. When the item on the property grid changes, it takes almost 400 ms to just set the new item to the property grid. 

    I tried a test application and saw that with the number of proeprties increasing, the performance of the property grid gradually deteriorates.
    Attached is a screenshot of the performance profile taken. Please help analyze and suggest how this can be improved. 

    Please note: IsVirtualizing and EnableEditorCaching are enabled.
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 18 Dec 2013 Link to this post

    Hi Weicong,

    Can you try setting RenderMode property to "Flat"? Do you get the same performance ? Also, is your property grid placed in a control measuring its children with infinity ?

    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Weicong
    Weicong avatar
    4 posts
    Member since:
    Jun 2012

    Posted 18 Dec 2013 Link to this post

    RenderMode=Flat does not improve the performance. 
    Also the container for the propertyGrid is a Grid, as far as I understand it does not measure it children to infinity. Tried with DockPanel and that doesnot do it either. 

  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 18 Dec 2013 Link to this post

    Hello Weicong, 

    It is strange that you get such performance as RadPropertyGrid works pretty great with a bit more properties displayed (as you can see in our demos). Is there anything more specific that you do ? What are your exact settings and definition of the property grid ?

    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Weicong
    Weicong avatar
    4 posts
    Member since:
    Jun 2012

    Posted 18 Dec 2013 Link to this post

    This is the test app xaml: 
      <DockPanel>
        <Button DockPanel.Dock="Bottom" Click="ButtonBase_OnClick" Content="Change"></Button>
        <telerik:RadPropertyGrid Item="{Binding}" AutoGeneratePropertyDefinitions="True"/>
      </DockPanel>


    And the code is: 

          Person1 = new Person() { Age = 1, FirstName = "FN1", Gender = "F", LastName = "LN1" };
          Person2 = new Person() { Age = 2, FirstName = "FN2", Gender = "F2", LastName = "LN2" };

    On button click  :
          if (DataContext == null)
            DataContext = Person1;
          else if (DataContext as Person == Person1)
            DataContext = Person2;
          else if (DataContext as Person == Person2)
            DataContext = Person1;


    The time taken to change the Item increases with the increase in properties in Person object. 
    I see the ProeprtyGridField is created everytime the Item changes, rather than just updating the values for the property.

  7. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 19 Dec 2013 Link to this post

    Hello Weicong,

    Can you try placing RadPropertyGrid in a Grid for example instead of DockPanel ? Do you get the same performance ?


    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. Weicong
    Weicong avatar
    4 posts
    Member since:
    Jun 2012

    Posted 19 Dec 2013 Link to this post

    Hi Maya, 
    No change in performance with the change in the panel.

    Can you look at the stack trace I attached with the first email and try to see why that happens at all?
    Can you please check why the PropertyGridField is recreated even when the property definition does not change? And why we just do not update the value?

    And may be could you also check - irrespective of the Panel, why does the control behave that slowly?

    Thanks,
    Shweta
  9. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 23 Dec 2013 Link to this post

    Hi Weicong,

    Will it possible to try one more thing in your application ? Could you call SuspendMethod() of PropertyDefinitions collection, change the Item and call ResumeNotifications afterwards ? Are there any changes ? 

    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WPF is Visual Studio 2017 Ready