[
Lists Home |
Date Index |
Thread Index
]
- From: David Megginson <david@megginson.com>
- To: xml-dev@ic.ac.uk
- Date: 20 Dec 1999 11:02:24 -0500
Miles Sabin <msabin@cromwellmedia.co.uk> writes:
> > If I were doing it over, though, I would actually call
> > java.lang.String.intern once for each of the strings in the
> > intern table so that they were == to the regular intern'ed
> > versions.
>
> Try it, but I think you'll be more likely to lose than gain.
I'd appreciate more information here -- if I call
java.lang.String.intern the first time I add a string to the intern
table, then the cost is proportional to the number of entries in the
table, not the number of accesses.
Or, in plainer English, if the XML name "div" appears 20,000 times in
my document, and I have my own custom intern() routine that calls
java.lang.String.intern only when a new name is added to the table, I
will still incur the cost of java.lang.String.intern only once, not
20,000 times. The benefit is that my interned strings will still be
== to those from java.lang.String.intern. I wish that I had done it
this way for AElfred.
> But all this seems to suggest that the use of java.lang.String.
> intern() and java.util.Hashtable isn't that good an idea.
> Insofar as SAX defines interfaces you can leave the choice to
> implementors. But wiring them into the implementation of SAX
> utility classes (eg. your NSUtils) would mean that we don't
> get the option.
I think that NSUtils is dead -- it was a trial balloon, and a pretty
successful one as far as it went. I am convinced that the
single-string approach is not suitable for Namespace-qualified names
in SAX2.
All the best,
David
--
David Megginson david@megginson.com
http://www.megginson.com/
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)
|