[jdom-interest] Time for SAXBuilder.build()

Brett McLaughlin brett.mclaughlin at lutris.com
Mon Oct 9 06:04:19 PDT 2000


"Freude, Stefan" wrote:
> 
> I want to use JDOM in an internet application where I get external data in
> XML format.
> Every XML file has to parse with JDOM. Now I have noticed that the
> SAXBuilder.build() method needs a lot of time.
> Consider the very simple XML-file
> 
> <Book/>
> 
> In my code there are the following lines:
> 
> SAXBuilder builder = new SAXBuilder(false);
> long time1 = System.currentTimeMillis();
> Document doc = builder.build(uri);
> long time2 = System.currentTimeMillis();
> 
> Before and after the build call I take the time. The unexpected result is a
> time of about 2200 milliseconds (on a PII 450 under NT 4.0).
> That´s too long for my application. If the XML-file is more complex the time
> used for build is only a few milliseconds greater.
> 
> What can I do to reduce this warmup time?

If someone with JProbe or a fancy IDE wants to step through the code
here, and see what's going on, that's great. Obviously, we spend a bunch
of time in the SAXBuilder that could be lessened if we had direct hooks
into a parser, like I'm working to get into Xerces 2. Other than that,
I'm not sure that much can be cut out... but if someone looks at it and
comes up with something, I'm more than happy to work on it.

I've been too busy on features to do much on performance, but I'm happy
to try and help ;-)

-Brett

> 
> Regards, Stefan
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

-- 
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc. 
1200 Pacific Avenue, Suite 300 
Santa Cruz, CA 95060 USA 
http://www.lutris.com
http://www.enhydra.org



More information about the jdom-interest mailing list