I'm evaluating Apache CXF for a project so I wrote a small demo application to try a few things out. Following the CXF user's guide, I was able to get my application up and running pretty quickly.
One thing I wanted to test was how well CXF is able to handle a method that returns a large array of primitives. So I defined a method 'float[] getRandFloats(int count)
' which simply returns an array of the specified length filled with random numbers. Looking at the WSDL generated by java2wsdl
, I see the method correctly indicates a return type of float[]
. Inspecting the client side, I also see that I'm (ultimately) receiving a float[]
.
I noticed as I increase the number of elements in my array, the client performance suffers. I ran a profiler on the client-side and saw that there are Float
objects being created for every element in the returned array. It seems this is happening when CXF invokes JAXB during the parsing of the response.
I'm evaluating CXF for use with an application that potentially sends back millions of floating point numbers so this object creation is highly undesirable. In order to use CXF, I'd need to find a way to prevent this object creation from happening. I've scanned through the documentation and mailing list, but haven't come up with a way to work around this.
Has anyone encountered a similar problem using CXF? If so how did you work around this?