Michael Mason wrote: > So it's better to iterate over the children by hand than to use a > NodeList? I've been noticing that (for example) removing all the items > in a NodeList seems to take longer than I'd hoped.
Yep, NodeLists are really bad for performance. Definitely use the getFirstChild/getNextSibling paradigm. > We're migrating some of our code from using SAX and a DIY tree structure > to manipulations of a DOM tree, and I certainly don't want it to perform > slower. Is there a DOM performance-FAQ or similar I should be reading? Since version 1.0.2, we've added a "Performance FAQ" to the list of available FAQ information. Unfortunately, this little tidbit of information (as well as others) are missing. We should add another subsection of the Performance FAQ to include performance when programming to the DOM. Anybody want to write something up and contribute it? -- Andy Clark * IBM, JTC - Silicon Valley * [EMAIL PROTECTED]