1

How do I speed it up?

I get the results from JSON web service (lightning fast). Adding nodes to the tree using

something like

parentNode.addChild({
        key: key,
        title: value,
        addClass: cssClass
    });

Unfortunately, a tree with 100+ elements takes 1.5 minutes to load. I am disappointed...is it not made to be used with that many nodes? Anything I can do at this point aside from switching to another component?

Thanks!

sarsnake
  • 26,667
  • 58
  • 180
  • 286

2 Answers2

1

This benchmark shows that it is loads pretty fast: http://wwwendt.de/tech/dynatree/doc/test-bench.html (Theres always room for improvement though...)

Your problem might be, that you load and add the nodes seperately? In this case the tree is also rendered 100+ times, and that is slow indeed.

Have a look at the sample, to see how load a batch of nodes with one call: http://wwwendt.de/tech/dynatree/doc/sample-lazy.html

mar10
  • 14,320
  • 5
  • 39
  • 64
  • yes indeed. i found that out yesterday. it would help to say that in the notes for dynatree:) I was adding each node separately. The faster method would be to pass an array of children (initialized according to format) to a node.... – sarsnake Feb 11 '10 at 19:54
0

Looks like there is an example of lazy loading the tree. Might try that out: http://wwwendt.de/tech/dynatree/doc/samples.html

PetersenDidIt
  • 25,562
  • 3
  • 67
  • 72
  • as I said the delay is not on the database side or web service side, it's populating the tree that's slow..... i am working on it now and will report with the results, hopefully others will benefit. – sarsnake Feb 11 '10 at 17:46