How to use enableDistributedPars in dhtmlx tree?

I have two large trees. One tree has 10733 nodes and another has 23728 nodes.

For the tree with 10733 nodes, I was able to improve the performance of the tree rendering process by using enableSmartXMLParsing(1), and enableDistributedParsing(1,557,200), meaning enable Smart XMl parsing and parse 557 nodes by one step with 200 milliseconds delay.

Without these settings the tree was taking 10 minutes to display, during which my local computer’s CPU utilization shoot up to the maximum. I have confirmed that this single line of code is responsible for this slowness: var myTree = dhtmlXTreeFromHTML(‘treeId’);

However, for the bigger tree with 23728 nodes, with the same setting described above I simply received javascript errors like “non-unique|incorrect IDs in tree’s XML”. I know that there are no incorrect IDs in my tree because without using “enableSmartXMLParsing” and “enableDistributedParsing”, I was able to render the tree successfully without errors but it took 15 minuutes to display the bigger tree. Also, I received similar errors when tested with the smaller tree with 10733 nodes and I was able to resolve it by increasing the second parameter (critical count to start distibuting) of enableDistributedParsing from 200 to 557.

Is there a more reliable way of deriving the correct value for the second parameter of the method “enableDistributedParsing”? Any hints/helps are very appreciated.

Try to use SmartRendering instead of DistributedParsing:


DistributedParsing parses all data and it is not a solution if all 10 thousand nodes are in one level. SmartRendering will parse only nodes that should be shown.


Thank you so much for your suggestions and I really appreciate it.
However, SmartRendering won’t work in my case as it isn’t compatible with another required feature “enableThreeStateCheckboxes”.

I some how able to by-pass the javascript errors like “non-unique|incorrect IDs in tree’s XML” for my bigger tree with 23728 nodes, by only displaying first level nodes and closing/collapsing everything under them. Before, it was displaying both fist and second level nodes.

Thank you for your help again.