Skip to main content

JaxB conversion is taking too much time

2 replies [Last post]
arunvpy
Offline
Joined: 2012-01-26
Points: 0

Hi All,

I have an issue with XML conversion to java using JAXB. The scenario is,

I have to parse a huge xml file to java objects. The xml will hold 30000 complex types with each one holds about 20 string elements. While parsing, it is taking 4 minutes to convert it in to java.

Could somebody show me some light to reduce the time taken for this conversion ?

Thanks in advance,
Arun

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
snajper
Offline
Joined: 2004-10-01
Points: 0

Which version of JAXB do you use? Do you really need to convert the whole XML? JAXB RI supports partial conversion e.g. - see [1]. for more info, there are additional samples in the standalone distribution. It would also be useful to share your schema and typical xml and do some profiling on where the time is spent.
MartiNG

[1] http://jaxb.java.net/guide/Dealing_with_large_documents.html

arunvpy
Offline
Joined: 2012-01-26
Points: 0

Thank you snajper :)

Yes,I really need to convert the whole XML. The average size of the XML will be always 30 t0 45 MB.

-Arun