I just checked in a change to our DOM implementation that leads to an
improvement of the memory footprint of up to 7% without much degradation
of the perfs. This has to do with the way I handle the cache of the
NodeLists (for getLength() and item(i)). I moved the fields into
separate objects that are only created when necessary and maintained in
a pool on the document. In a typical traverse of the tree we only need
"document depth" instances of them. So we gain by having smaller nodes,
and fewer caches (by large!).
There is one diff in perfs though. Because the cache objects are reused,
the length of the list (the number of children) has to be recomputed on
each node every time you traverse the tree. So, you may see an impact if
you do several traverses of the same document. It's still of the same
order though.
Traverses through the use of getFirstChild() and getNextSibling() are
not affected in any way. This only concerns people using
getChildNodes().
Let me know if you find any problem. Thanks.
--
Arnaud Le Hors - IBM, XML Standards Strategy Group / W3C AC Rep.
PS: thanks to Andy Heninger for his help in designing this and thinking
it through.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]