JAXB marshalling performance with nested classes [message #1688363] |
Fri, 20 March 2015 10:37 |
Eclipse User |
|
|
|
I thought I'd go straight to the source. I have 3 complex classes Grandparent, Parent and Child that have a nested hierarchy as follows:
One grandparent contains many parents, a parent has many children
I need to marshal the grandparent with all the sub-data to XML but I also need the XML for individual parents (with sub-data). So I have all 3 classes with a @XmlRootElement definition.
This works at the moment but marshalling gets really slow. i create a single context with all 3 classes and marshal both grandparents and parents from this reusing a single marshaller per thread. I have to create the parent (+children) XML standalone, so I have to run a marshal for the overarching object, then the individual parents one by one.
I'm seeing a lot of:
2015-03-20 12:50:21,274 [Thread-8] INFO resolver.DefaultTraversableResolver - Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
in my logs. I'm seeing marshal times on the grandparent level of up to 12 seconds for a single entry (~25 atomic type fields). It's cascading down into each parent with its children though, and unmarshalling works. I need to marshal over 50 of these per second but no dice 
Any ideas?
Cheers,
Ben
|
|
|
Powered by
FUDForum. Page generated in 0.27819 seconds