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

philip.nelson at omniresources.com philip.nelson at omniresources.com
Mon Oct 9 05:46:00 PDT 2000

> 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();

Try running the same test multiple times in a loop instead run once and
quit.  Most likely the time is spent loading the Xerces classes.

While I think the overhead of parsing is high, this is out of bounds...

> What can I do to reduce this warmup time?

More information about the jdom-interest mailing list