users@jaxb.java.net

Re: Unmarshal performance

From: Rob Collins <RobC_at_limesoft.com>
Date: Wed, 20 Nov 2002 16:17:21 -0800

Kohsuke,

Thanks for the response.

Your suggestions were the first things I had checked. No external references
exist in the XML document. No validation is being performed.

Yes, my CPU is pegged. This is on a PIII ~800MHz system with plenty of
memory.

I don't know if it is relevant, but most of the elements in these documents
have 70-100 optional attributes (all of which happen to be included in the
file). These attributes are of type xsd:string.

The schema is about 275KB and JAXB generates ~500 Java source files. Again,
the schema file is not referenced in the XML file itself.

I notice about 8-10 seconds of additional pause when the first file is
unmarshalled (presumably loading classes). Subsequent files are faster but
still much too slow: e.g., 315KB in 4.9 seconds.

Help!

Thanks,
Rob

> -----Original Message-----
> From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
> Sent: Wednesday, November 20, 2002 4:00 PM
> To: JAXB-INTEREST_at_JAVA.SUN.COM
> Subject: Re: Unmarshal performance
>
>
> > I am evaluating the beta release and seem to be seeing horrible
> > performance when I unmarshal a large XML file. The performance I am
> > seeing is about 64KB of source XML per second. Is this to
> be expected?
> > Is this way out of whack for what other people are seeing?
> Is the FCS
> > going to be significantly faster? Any suggestions?
>
> The first thing I would suspect is that documents are either
> referring to
> external DTD through DOCTYPE or external schema files through
> xsi:schemaLocation.
>
> The chances are that your XML parser is configured to retrieve those
> files, parse them, and validate them before XML is parsed and
> passed to
> JAXB. Please note that most XML parsers are configured in this fashion
> by default.
>
> This slows down parsing considerably since it involves in
> additional I/O.
> Is your CPU utilized 100% while you are measuring performance?
>
> I don't think JAXB RI is super fast, but 64KB/sec doesn't sound right,
> neither.
>
>
> regards,
> --
> Kohsuke KAWAGUCHI
> Sun Microsystems kohsuke.kawaguchi_at_sun.com
>