iTwin / imodel-native

Apache License 2.0
20 stars 12 forks source link

Investigate possibility to avoid determining children of all nodes in `Same label grouping nodes post-processor` #246

Closed grigasp closed 1 year ago

grigasp commented 1 year ago

https://github.com/iTwin/presentation-performance-tests/issues/70#issuecomment-1511303070 shows that Models Tree initial load takes a long time on specific iModels because we have to determine children for a very large number of Subject nodes. Generally that's avoided by going it just for the requested page, but in that situation Models Tree uses same label grouping at post-processing step, which requires getting the whole hierarchy level.

Need to investigate ways to improve this. Would it be possible to get the whole hierarchy level without determining children for the nodes? We could merge them without having done that and determine children for a page of merged nodes afterwards.

grigasp commented 1 year ago

Looked into this as part of https://github.com/iTwin/viewer-components-react/issues/439.

We're the children NEED to be determined due to the hideNodesInHierarchy and hideIfNoChildren attributes that get applied recursively to Subject hierarchy. They require us to load deeper hierarchy levels to determine the output nodes of the upper hierarchy level. We need to get the upper hierarchy level to know what we're merging in same label grouping nodes post-processor.

Conclusion - can't be done without breaking existing use cases.