Ticket Q455387
Visible to All Users
Duplicate

Slow typing with high CPU usage

created 12 years ago

I have a DetailView which, with heavy tab usage, has roughly 400 fields on it. No users see all the fields, I'm using AppearanceRules to selectivly hide entire tabs worth of fields, based on the user's group membership.
My problem is that, once above roughly 300 non-hidden fields, typing in simple text boxes begins to slow down. By roughly 375 fields, a reasonable typest can be at least a sentance ahead of the display when typing 3 sentances of text. Also, while the typing and catchup is happening, the program will max-out a CPU. The textbox I've used for testing is one without any formatting, validation or calculations.

I'm most concerned about the cause of the CPU utilization - without any validation or calculations in play, do you have any suggestions on what may be causing it?

I'd appreciate any suggestions
--Will

Answers approved by DevExpress Support

created 12 years ago (modified 6 years ago)

Hello Will,
Thank you for contacting us. There can be really a difference in speed when Appearance customizations are used, as opposed to when they are not. It is expected that execution with the ConditionalAppearance module will be slower because the module tracks object changes and evaluates rules against object values. If you have a lot of Appearance rules and also use the ImmediatePostDataAttribute, this slowness may be really noticeable as in your particular case.

Usually, when this happens, most time is spent within the layout control to perform internal recalculations and adjustments. For instance, every time you type in the editor with ImmediatePostData=True, the ObjectSpace.ObjectChanged event is raised. This leads to the updating of appearance rules for the DetailViewItemAppearanceController and DetailViewLayoutItemAppearanceController classes.

A general solution to overcome this slowness is to avoid unnecessary updates for every sneeze by the following:

  1. modify your data model. For instance, you can remove ImmediatePostData attributes from your properties, where it is possible. You can also suppress intermediate notifications and raise only a single notification when the batch modification is finished as described at Performance impact with ConditionalAppearance.
  2. reduce the number of appearance rules or force them to work for a layout group rather than for a precise item. This can be accomplished by combining all necessary fields to be hidden into layout groups and creating appearance rules that will hide this particular group instead of all fields. You should also avoid mixing appearance rules with the LayoutItem and ViewItem types whenever possible on the same form.
  3. Consider reworking your UI to avoid extensive layout operations with 400 fields. That is probably not the best UX that can be improved by providing separate screens.
  4. Prevent ObjectChanged events upon every keypress as per S171794 (especially when MasterDetailMode = ListViewAndDetailView).

These are best suggestions we can give you at the moment without debugging and profiling your sample project. Please implement them and let us know your results.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.