This is an experiment at changing the internal DOM structure
from a linked list based structure to an array based structure.
The array based structure comes from Crimson.
This structure is inherently more compact, but the gain in memory can only
be achieved at the expense of a performance hit. Indeed, the problem with
arrays is that you never know what size to give them in the first place.
Crimson's implementation uses an original size of 5, and doubles this size
every time it reaches the limit. In addition, it provides for a method to be
called when additions to the node are finished to resize the array the size
actually needed. This is called for instance by the parser in the endElement
callback. But, if this leads to less memory waste it also means a bigger
performance hit.
At any rate, I was expecting quite a bit of improvement but the tests I've
run so far have been very disappointing. It is much slower, and it appears
to use more memory. I just don't understand what's going on. Nevertheless,
I'm checking this into a CVS branch so this work isn't completely lost and
can possibly be looked at further some other time.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68
10 files changed
tree: eb723b04b40e72280b68815bbbceb015591cda6f
  1. src/