nickperkinslondon / angular-bootstrap-nav-tree

An AngularJS directive that creates a Tree based on a Bootstrap "nav" list.
MIT License
681 stars 301 forks source link

Slow with over 2000 branches #58

Open Graham42 opened 9 years ago

Graham42 commented 9 years ago

Performance is really poor when dealing with a large tree.

jangu commented 9 years ago

This is probably due to an AngularJS limitation - 2000 watchers (through ngRepeat implementation) suffers in performance.

smee commented 9 years ago

I didn't test with 2000 nodes, but I experienced the same slowdown in my usecase. A workaround might be not to use deep watching for the whole tree data (which means multiple copies for each digest cycle). Instead, using JSON.stringify(treeData) works for us. See https://github.com/smee/angular-bootstrap-nav-tree/commit/8866da0edc1872e8a7e1acd410356f1d1952973e

codeandcats commented 8 years ago

I have 8,000 nodes in my tree, it takes about 15 seconds to load, and any operation after that (expanding, collapsing or even simply selecting a node) will freeze the page for 15 seconds each.

Might be time for me to finally learn React. :stuck_out_tongue: