ual dom trees allows writes to be batched into a single repaint. Also, the performance characteristics of various DOM operations vary between implementations and can be difficult to learn and optimize for all browsers. For example, in some implementations, reading <code>childNodes.length</code> has a complexity of O(n); in some, reading <code>parentNode</code> causes a repaint, etc.</p>
<p>In contrast, traversing a javascript data structure has a much more predictable and sane performance profile, and in ad