Make JAXB go faster Make JAXB go faster xml xml

Make JAXB go faster


1 - How do I make JAXB go faster?

You are on the right track with unmarshalling from a StAX input, but I would recommend a XMLStreamReader instead of a XMLEventReader.

XMLInputFactory xmlif = XMLInputFactory.newInstance();XMLStreamReader xmler = xmlif.createXMLStreamReader(fr);

Since StAX is a standard you can switch in another implementation such as WoodStox as the underlying parser.

2 - How can I be 100% sure what underlying parsing mechanism it is using?

Just like you are doing. If you pass a JAXB implementation an instance of XMLStreamReader then you can be reasonably sure that it is being used. If on the other hand you unmarshalled from something like an InputStream then the JAXB implementation is free to use whatever parsing technique it wants to. If you go with Woodstox be sure to check out there performance page as well:


I haven't tried these, but EclipseLink provides a JAXB implementsion. http://www.eclipse.org/eclipselink/moxy.php Jibx is supposed to be fast, but I don't think its a JAXB implementation. Although it does the same thing. http://jibx.sourceforge.net/index.html

If EclipseLink is compliant, then you should be able to just drop it in and try it. Not sure about the effort to test Jibx.