Our WPF app has an internal diagnostic mode that when enabled, will capture the stack trace of the UI thread whenever it has detected that the UI thread has been "overly busy" for a period of time. Analysis of a customer who is experiencing intermittent momentary UI lockups shows that the UI thread is often in the call stack below:
.
at Infragistics.Windows.DataPresenter.CellLayoutItem.GetSize(LayoutItemSize size)
at Infragistics.Windows.DataPresenter.LayoutItem.Infragistics.Controls.Layouts.Primitives.ILayoutItem.get_PreferredSize()
Any ideas on the improving the performance of this method? Infragistics v12.1.
Hello Brian,
Thank you for your post!
I have been looking into your it and it seems that I am missing something from your scenario. Would you please provide me with more detailed information about the functionality you are using? Also would you please provide me with more detailed information regarding the steps that you perform in order to see the UI lock?
Additionally I would suggest updating your application to the latest version of Infragistics control - 15.1, because the performance of the XamDataPresenter has been optimized since version 12.1. Does the issue reproduce with the latest version of the control too?
Looking forward to hearing from you.
Thank you Gergana.
Unfortunately we are unable to upgrade to 15.1 because we have to stay with .net 3.5 so that our clients who are still running XP can still run our product.
I've done additional digging, and found that when this lockup occurs, the user changes an input parameter which causes the xamDataGrid to repopulate with new data. Our code then ends up calling BringRecordIntoView in order to scroll a specific record into view. I've timed the call to BringRecordIntoView, and in certain cases it can take up to 2-3 seconds to complete. When it takes this long, the call stack captured from the UI thread is almost always somewhere inside of get_PreferredSize, which either means that it's being called very very frequently, or that it's a standout slow method, or a bit of both. The call stack is always inside an UpdateLayout call, performing a measure pass.
Asking the question a slightly different way: Do you have any suggestions on how to make a call to BringRecordIntoView faster? I'm not the original coder of this, so it's all a bit new. Is BringRecordIntoView something we should be avoiding and there is a more efficient way to accomplish scrolling a specific record into view? Or can you definitely state that later versions of xamDataGrid have made BringRecordIntoView X times faster?
Here is an example of a more complete call stack:
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable) at System.Array.Copy(Array sourceArray, Int64 sourceIndex, Array destinationArray, Int64 destinationIndex, Int64 length) at System.Windows.DependencyObject.InsertEntry(EffectiveValueEntry entry, UInt32 entryIndex) at System.Windows.DependencyObject.SetEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry newEntry, EffectiveValueEntry oldEntry) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType) at System.Windows.StyleHelper.ApplyTemplatedParentValue(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, DependencyProperty dp, FrameworkElementFactory templateRoot) at System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, Boolean isDetach, FrameworkElementFactory templateRoot) at System.Windows.StyleHelper.LoadOptimizedTemplateContent(DependencyObject container, ParserContext parserContext, OptimizedTemplateContent optimizedTemplateContent, FrameworkTemplate frameworkTemplate, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField) at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField) at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate) at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container) at System.Windows.FrameworkElement.ApplyTemplate() at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at Infragistics.Windows.DataPresenter.VirtualizingDataRecordCellPanel.TryGetPreferredExtentImpl(FieldLayoutItemBase fieldLayoutItem, Size newSize, FrameworkElement element, Int32 templateIndex, Boolean width) at Infragistics.Windows.DataPresenter.VirtualizingDataRecordCellPanel.TryGetPreferredExtent(FieldLayoutItemBase fieldLayoutItem, Boolean cell, Boolean width, Double& extent) at Infragistics.Windows.DataPresenter.CellLayoutItem.GetSize(LayoutItemSize size) at Infragistics.Windows.DataPresenter.LayoutItem.Infragistics.Controls.Layouts.Primitives.ILayoutItem.get_PreferredSize() at Infragistics.Controls.Layouts.Primitives.GridBagLayoutManager.GridBagConstraintCache..ctor(ILayoutItem item, IGridBagConstraint gc) at Infragistics.Controls.Layouts.Primitives.GridBagLayoutManager.GetGridBagCacheHelper(GridBagConstraintCache[]& tmpGccArr) at Infragistics.Controls.Layouts.Primitives.GridBagLayoutManager.CalculateGridBagLayout() at Infragistics.Controls.Layouts.Primitives.GridBagLayoutManager.GetGridBagLayoutCache() at Infragistics.Controls.Layouts.Primitives.GridBagLayoutManager.CalculatePreferredSize(ILayoutContainer container, Object containerContext) at Infragistics.Windows.DataPresenter.FieldGridBagLayoutManager.CalculatePreferredSize() at Infragistics.Windows.DataPresenter.VirtualizingDataRecordCellPanel.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at XXXXXX.Renderer.MeasureOverride(Size availableSize) in c:\DevMerge\Trunk\Infrastructure\Gemstone\Controls\Controls.Primitive\Controls\Renderer.cs:line 106 at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at Infragistics.Windows.DataPresenter.DataRecordCellArea.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at Infragistics.Windows.DataPresenter.RecordPresenter.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Decorator.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at Infragistics.Windows.DataPresenter.GridViewPanelNested.GenerateRecordPresenters(Size adjustedConstraint, Boolean topFixedRecordsOnly, Boolean bottomFixedRecordsOnly, Int32 rootTopFixedAdjustment, HeaderPlacement headerPlacement, Int32 maxRecordsToGenerate, Record& topRecordDisplayed, Record& lastRecordDisplayed, FieldLayout& lastFieldLayout, Int32& highestItemIndexProcessed, Int32& numberOfRecordsGenerated) at Infragistics.Windows.DataPresenter.GridViewPanelNested.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at Infragistics.Windows.DataPresenter.RecordListControl.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at Infragistics.Windows.DataPresenter.RecordPresenter.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Decorator.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at Infragistics.Windows.DataPresenter.GridViewPanelNested.GenerateRecordPresenters(Size adjustedConstraint, Boolean topFixedRecordsOnly, Boolean bottomFixedRecordsOnly, Int32 rootTopFixedAdjustment, HeaderPlacement headerPlacement, Int32 maxRecordsToGenerate, Record& topRecordDisplayed, Record& lastRecordDisplayed, FieldLayout& lastFieldLayout, Int32& highestItemIndexProcessed, Int32& numberOfRecordsGenerated) at Infragistics.Windows.DataPresenter.GridViewPanelNested.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at Infragistics.Windows.DataPresenter.RecordListControl.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at Infragistics.Windows.DataPresenter.RecordPresenter.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Decorator.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at Infragistics.Windows.DataPresenter.GridViewPanelNested.GenerateRecordPresenters(Size adjustedConstraint, Boolean topFixedRecordsOnly, Boolean bottomFixedRecordsOnly, Int32 rootTopFixedAdjustment, HeaderPlacement headerPlacement, Int32 maxRecordsToGenerate, Record& topRecordDisplayed, Record& lastRecordDisplayed, FieldLayout& lastFieldLayout, Int32& highestItemIndexProcessed, Int32& numberOfRecordsGenerated) at Infragistics.Windows.DataPresenter.GridViewPanelNested.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.UIElement.UpdateLayout() at Infragistics.Windows.DataPresenter.DataPresenterBase.BringRecordIntoView(Record record)
I have been looking into your post.
.Net 4 can be installed on Windows XP and also the latest version of our components supports .Net 4. More about installing .Net 4 on Windows XP can be found here: http://blogs.msdn.com/b/dotnet/p/dotnet4xp.aspx . For more information on the supported environment of our components you can take a look at the following link from our website: http://es.infragistics.com/support/supported-environments.
Additionally the technical support for version 12.1 of our controls has expired( for more info, please take a look at the following link: http://es.infragistics.com/support/product-lifecycle ).
Having this in mind I would suggest updating your project to the latest version of Infragistics controls.
Please do not hesitate to let me know if you have any further questions on this matter.
Thank you Gergana. Unfortunately .net 4.0 has a bug or two that manifested itself broadly across our product and requires large amounts of changes in our source code. For net 4.5 and 4.6, these same problems are fixed in our product without the extensive changes to our source. XP is not supported in .net 4.5 and 4.6.
Currently we provide technical support( new service leases) for version 14.2 and 15.1. This can be seen on the Product Lifecycle page, I have provided in my previous post. For version 12.1 we do not provide new service release and also the support for this version is expired.
Additionally for trial account we provide support for the latest version, that we have( currently this is 15.1): http://es.infragistics.com/support/support-policies.
Having this in mind would you please provide me with more detailed information if the issue is reproducible with version 15.1 of our controls? If yes, would you please provide me with a small isolated sample application, that shows the issue? This way I would be able to further investigate this matter for you.