On Wed, 30 May 2001 16:54:40 -0700, Gary L Peskin <[EMAIL PROTECTED]> wrote:
> Yes. The branch is called DTM_EXP.
OK, I'll checkout the branch and take a look at it.
> Also, in the interests of reducing the number of classes, what do you
> think about using org.apache.xml.utils.SaxSourceLocator instead of
> NodeLocator? It does have an extra field in it but the classes do seem
> awfully close.
I was actually worried that each instance of my class takes too much
space, especially when we have large XML documents. So I was thinking
to optimize the storage for the class for different sizes of the line
and column number. Like having a class with an unsigned integer
holding both the line and column number when they both are less than
65535. And yet another one for column number less than 256 and line
number less than 2^24 - 1. Finally a generic one for the rest of the
cases.
Using a more generic class, which even has an additional field, makes
this optimization impossible. With the optimization described above we
can save up to 8 bytes per Node, quite a bit.
Another optimization that could save even more space and also increase
the speed is if we can keep a pointer to the NodeLocator instance in
the Node instance (I don't know what's the actual representation with
DTM). This way we get rid of the HashMap structure which has severe
performance problems with each addition to it that causes a resize.
Do you think it makes sense to have these optimizations?
Regards,
Ovidiu