IHierarhyNode interface is designed to accelerate the performance for hierarchical data in XAF application. Compared with ITreeNode, its effectiveness becomes appreciable when the amount of the data is over 1000 objects.

This post describes the results of comparing the performance of the processing of hierarchical data in XAF application. Results was obtained for Win platform. HierarchyNode solution includes 4 types of hierarchical objects:

TreeListObject implements DevExpress.Persistent.Base.General.ITreeNode interface. This is a simple class to implement the tree like structure in DevExpress XAF. Default editor for TreeListObject is DevExpress.ExpressApp.TreeListEditors.Win.TreeListEditor.

HierarchyNodeObject implements Xafari.Base.IHierarchyNode interface, it supports only one hierarchy.

HierarchyNodeDescendant implements Xafari.Base.IHierarchyNode interface, it supports 4 hierarchies.

HierarchicalClassifierItemDescendant implements HierarchicalClassifierItem interface.

We have monitored the following values:

  • the time of loading the data into List View
  • the time of expanding the node

When testing we used the following editors:

  • TreeListEditor to display TreeListObject
  • WinExplorerListEditor to display HierarchyNodeObject, HierarchyNodeDescendant
  • WinHierarchyNodeListEditor to display HierarchyNodeObject, HierarchyNodeDescendant and HierarchicalClassifierItemDescendant

Tested count = 2345 objects. Objects are generated as follows:

private void SetHierarchyNodeObjectDescendant()
    string name = "Node_0";
    HierarchyNodeDescendant theObject = ObjectSpace.FindObject(CriteriaOperator.Parse("Name=?", name));
    if (theObject == null)
        name = "Node_";
        for (int i = 0; i < count; i++)
            theObject = ObjectSpace.CreateObject();
            theObject.Name = name + i;
            if (i >= count/2)
                theObject.Parent = ObjectSpace.FindObject(CriteriaOperator.Parse("Name=?", "Node_1"));

Other types of data were generated similarly.

The table below shows obtained results (time in milliseconds).

Tree List EditorWin Explorer List EditorWin Hierarchy Node List Editor
Tree List ObjectHierarchy Node ObjectHierarchical Classifier ItemHierarchy Node DescHierarchy Node ObjectHierarchical Classifier ItemHierarchy Node Desc

1 – the time of loading the data into List View.

2 – the time of expanding the node.

Let see results in diagram form. The first figure shows the time of loading the data into List View, depending on the editor.



The second figure shows the time of first expanding the node, depending on the editor.

When working with large amounts of data, using WinExplorerListEditor was more effective compared to TreeListEditor and WinHierarchyNodeListEditor. WinHierarchyNodeListEditor and TreeListEditor gave almost equal performance. But WinExplorerListEditor uploaded the data 21 times faster and expanded the first node 14 times faster.

WinExplorerListEditor loaded HierarchicalClassifierItem objects 42 times faster and expanded the node 300 times faster.

HierarchyNodeDesc object implements 4 hierarchies, reaching almost the same results with the HierarchyNodeObject object, which implements only one hierarchy. This indicates that the presence of multiple hierarchies has no significant effect on the performance of the editor.

Topics in this section provide detailed information on hierarchical data in Xafari: each UI element.

To learn about the business model design, please refer to the following documentation sections:

The listed topics provide information on how Xafari supports hierarchical data properly declare your data classes

Write US