I also ran into performance issues with the dijit tree when a tree with 10,000+ nodes was loaded immediately, with ~ 3,000 items at the highest level. The tree had only one dummy root node, which loads the entire tree on the first click through an ajax call.
In this case, it took more than 1 minute to create the tree, and I got the message βStop running this script dialog" in IE8.
After applying several optimization steps, the tree now loads in 2 seconds in all major browsers (including IE8-IE11).
The first optimization I did was to use dijit/tree/ObjectStoreModel
as a tree model and dojo/store/Memory
as a data store.
This accelerated the insertion of ajax response json nodes into the tree data store.
The second optimization concerned the slow creation of tree nodes. It took more effort to fix:
I had to extend dijit/Tree
and override the setChildItems()
function (its part, which calls the _createTreeNode()
function).
I kept all the logic of setChildItems()
unchanged, just added the parallelization of creating tree nodes using this technique:
http://www.picnet.com.au/blogs/Guido/post/2010/03/04/How-to-prevent-Stop-running-this-script-message-in-browsers.aspx
Hope this helps, if necessary, I can post the source code of my workaround
source share