[jdom-interest] performance on tonights CVS

Bradley S. Huffman hip at a.cs.okstate.edu
Fri Mar 15 07:13:10 PST 2002


> 
> >I've been brainstorming with Brad about how to work around this so
> >there's no verification when using a parser.  Sadly with the package
> >breakout it's not easy.  It wasn't easy a year ago when we first faced
> >this.
> >
> 
> Would it be possible to make a package protected non-verifying 
> subclass of Text in org.jdom.input that could be used by SAXBuilder, 
> etc? To everything outside the org.jdom.input package this would just 
> be a Text object. Is it possible to subclass a public class with a 
> non-public class? Even if it has to be public, such a class still 
> might make sense.

Similar to what dom4j does with Abstract*, Flywieght*, and Default* versions
of it's classes.  In this situation I think it would be helpful to have
the factory implementation in the same package as the classes it creates.

I did a little checking last night and I don't think the checks are
the culpit. It's one pass over a char array, and as it was pointed out
to me, Verifier.checkCharacterData should succeed on the 1st "if" for most
characters.  Creating Text instances is probably the biggest slowdown 
between the two versions.

One thing that would be good to check is build a document in memory and
time it.  The idea being to determine if it's org.jdom.* classes that eat
up the time or if it's something in SAXBuilder/SAXHandler.  It will most
likely be a combination of factors.  All in all though, we should be have
build times on par with dom4j since our implementations are so simialer.

Brad



More information about the jdom-interest mailing list