When working with a complex multi-level datasource like the one described, it is expected for the browser to take some time to load all of the nodes as this is a resource heavy operation. The recommended approach is to use the loadOnDemand option (as you have already tried), which significantly reduces the load time.
However, in you case this will not work as efficiently because of the amount of data that needs to be loaded. I have performed some tests with the following Dojo
. Indeed it takes some time to load all of the nodes - 10 parents with 5 levels nested (20 children).
What I can suggest is to try loading this complex data in the Grid widget which can be configured to show a hierarchy. You can observe this behavior in the following Grid Hierarchy demo
. Additionally, you will be able to use virtualization or paging to reduce load time significantly.
I hope this helps. In case you have any other related questions, please do not hesitate to contact us.