From: "Arnold, Curt" <[EMAIL PROTECTED]>
(talking about DOMString)
>
> >Oops, I really meant StringBuffer, not String.
>
> Yea, it is closer to StringBuffer(). However, the Java bindings are
written in terms of String's.
It's actually kind of a combination of the DOM CharacterData methods,
which includes string mutation, and some of java.lang.string.
>
> >If it's immutable, then operator=() is out of the question. Do you
mean
> >conversion from DOMString to some other string type? Or conversion to
> >DOMString from some other string type?
>
> I was talking templates defining operator= overloads that would convert
const DOMString&'s to basic_strings.
basic_string<type> comes with conversions from null terminated (type *)
predefined, so you should be all set for conversion from XMLCh * strings
in the new DOM.
> It does appear that all the interfaces are defined in terms of XMLCh*'s,
not a
> DOMString in sight. I'm not adverse to
> defining the interfaces in terms of const XMLCh*'s, I'm just hostile
> to the current DOMString.
That pretty much summarizes the new DOM. XMLCh* everywhere, not a
DOMString in sight. Note that the new DOM XMLCh * strings are intended to
be mostly read only. Modification would involve allocating a new one and
letting the old one leak for the duration of the life of the document.
>
> I've run some profiles on both the existing threadtest and ithreadtest.
>
> The first thing that is interesting is that IDParentNode::insertBefore
takes about 15% of the total time, a lot of that checking for hierarchy
and ownership errors shouldn't occur when building the
> DOM from a file (but do need to be checked when calling the DOM from an
application).
Yes indeed, this would be a good optimization. The XML4J parser has
something like this - an internal flag to turn off most error checking
while building a DOM document with the parser.
>
> About 6% of the time is taken in the UTF8 transcoder (this on a file
with no characters with code higher than points than 127). Seems like
that could be whittled down a bit.
I've tried to get this one down already, and couldn't find anything more
to do to that loop. I tried several different forms without getting any
further improvement. The percentage looks even bigger with SAX.
The area most needing improvement (after going to the new DOM, that is) is
reducing the per-parse initialization overhead when processing a whole
series of small XML documents. This is the initialization to reset an
existing parser, which is something that must be done for each document,
and not the once-per-process xml platform initialization, which doesn't
matter nearly as much.
Andy Heninger
IBM, Cupertino, CA
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]