Custom Module Speed - Treeview (Grouped/Nested) vs ListView

Looking for comments on Custom Module performance from anyone who has used nested/grouped Items in a Custom Module with large data sets.

I have a Custom Module with several thousand items. The data has a natural parent child hierarchical structure but can also be grouped by categories & classes.

The Detail View for each Item must include a list of the Siblings in a menu.

I have the following 2 methods working in test with a limited set of data.

Method 1

Structure the Custom Module as a simple list of Items. Each Item would have a Custom Property containing the Name or the ID of it’s parent.

Siblings would be located with the following code:

{% component source: "Landscape", layout: "List", filterBy: "GeoLoc", filterValue: "{{this['Id']}}", limit: "2000", type: "module" %}

  • Pro: Can import the entire dataset into the Custom Module in a single step

  • Con: Care is needed to ensure the parent Property (in this case GeoLoc) contains the correct data

Method 2

Structure the Custom Module as a Tree. The Parent would be stored in the Item’s ParentID - no need for a custom property

Siblings would be located with the following code:

{% component source: "Landscape", layout: "List", filterBy: "parentid", filterValue: "{{parentData.items[0].id}}", limit: "2000", type: "module" %}

  • Pro: The ParentID replaces the Custom Property and is always correct, assuming the Item was created under the correct parent

  • Con: There is no global import - can only import the offspring for a particular parent - many imports are required to load all the data

  • Con: There is no gobal export either - data could be listed on a web page & copied to a spreadsheet manually.

My questions are:

In each Method the code used to locate the Siblings is almost identical.

  1. Will Method 2, filtering by Parent ID, be more efficient & run faster than Method 1, filtering by a Custom property, when there is a large set of data?

  2. Is filtering by an ID faster than filtering by a Custom Property?

  3. Is the performance gain, if any, likely to outweigh the effort required to build/maintain the hierarchical Parent/Child data structure within the Nested Custom Module?

My next step will be build the Tree Structure & compare the 2 Methods. Any comments/suggestions would be appreciated. Thanks.

Hi @peter.medbury.
I don’t know the answers to 1. and 2. but I wouldn’t think they’d be any different in terms of performance.

But to avoid the extra effort of a nested module and the limitations there with import/export, could you use a ‘Data Source’ field for the linking instead? That way you can import all child items in one go with the custom datasource ID added to assign to the various parent items.
And listing the items would be much the same method as you already have.