5 Replies Latest reply on May 18, 2005 11:12 AM by Ole Matzura

    serialization performance improvements..

    Ole Matzura Novice

      Hi all!

      I've been doing some performance tests on jbossws and have had some problems with the built in ElementSerializer which is used when creating "nodatabinding" web-services which return SOAPElements from webservice methods (we do all xml-data-binding with xmlbeans).

      The ElementSerializer uses the writeDOMElement in SerializationContext(Impl) to write the SOAPElement to the response stream. Benchmarking the writeDOMElement method shows that is it extremely slow when compared to standard xml-serialization with the xerces-j XMLSerializer (a factor of 10!)..

      Based on these findings I replaced the call to writeDOMElement in the ElementSerializer with serialization using a pool of xerces-j XMLSerializers and writing the serialized result with SerializationContext.writeString. This has has substantially increased overall performance of our services (factor of 2-3), especially for large messages (factor of 5-6). All jboss-webservice tests passed ok.

      Performing the same initial tests on the 4.0.2 sources show that these are still 3-4 times slower than our solution, but I haven't tested replacing the 4.0.2 ElementSerializer in a deployed environment.

      so now I wonder why this is the case :-) Does writeDOMElement do anything that the XMLSerializer can/will not? Will future versions address this issue? How can I help?