You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Ke...@carefirst.com on 2001/02/01 16:09:52 UTC

Performance problem with methods that return large strings

I have been charged with SOAP-enabling an EJB that returns a large XML
string (typically on the order of 3 MB) from one of its methods.  I have a
simple wrapper SOAP service that delegates method calls to the EJB.  All
has gone well, except that I have experienced VERY poor performance on the
client-side of the SOAP call -- specifically, the process of extracting and
decoding the return value can take an enormous amount of time for large
values. I'm guessing string manipulation is where the bulk of time is being
spent -- the return value is an XML document, so there are quite a few
occurrences of < and > that must be replaced.

My questions are ...

1. Is this a known problem to be addressed in a future version?  Should I
expect version 2.1 to show an improvement?
2. Will it be possible in 2.1 to return this value as an attachment to the
SOAP response?  If so, would that approach avoid the need to encode &
decode the return value?
3. Are there any other suggestions for how to alleviate the problem?
Assume that the EJB interface is fixed -- I'm stuck with a ~3MB return
value.

Thanks in advance for any and all comments/suggestions!

Kevin Cox

BTW ... here are some numbers from a performance analysis I recently
completed:

Return Size (KB)     Time to Extract/Decode Return Value (sec)
  2                    0.010
  6                    0.261
 19                    0.812
 27                    1.603
 39                    3.154
 51                    5.538
 71                   11.647
 97                   27.249
136                   69.690
233                  232.725
449                  860.078  !!


Re: Performance problem with methods that return large strings

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
Kevin.Cox@carefirst.com wrote:

> Return Size (KB)     Time to Extract/Decode Return Value (sec)
>   2                    0.010
>   6                    0.261
>  19                    0.812
>  27                    1.603
>  39                    3.154
>  51                    5.538
>  71                   11.647
>  97                   27.249
> 136                   69.690
> 233                  232.725
> 449                  860.078  !!

it looks like n^2 growth for bigger size (and should be linear) so i would
suspect that it may be memory related problem (specifically i had very bad
experience with StringBuffer.append). what is cpu and memory usage on the
machine that you run tests?

thanks,

alek
--
Aleksander Slominski, LH 316, IU, http://www.extreme.indiana.edu/~aslom
As I look afar I see neither cherry Nor tinted leaves Just a modest hut
on the coast In the dusk of Autumn nightfall - Fujiwara no Teika (1162-1241)



Re: Performance problem with methods that return large strings

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
Kevin.Cox@carefirst.com wrote:

> Return Size (KB)     Time to Extract/Decode Return Value (sec)
>   2                    0.010
>   6                    0.261
>  19                    0.812
>  27                    1.603
>  39                    3.154
>  51                    5.538
>  71                   11.647
>  97                   27.249
> 136                   69.690
> 233                  232.725
> 449                  860.078  !!

it looks like n^2 growth for bigger size (and should be linear) so i would
suspect that it may be memory related problem (specifically i had very bad
experience with StringBuffer.append). what is cpu and memory usage on the
machine that you run tests?

thanks,

alek
--
Aleksander Slominski, LH 316, IU, http://www.extreme.indiana.edu/~aslom
As I look afar I see neither cherry Nor tinted leaves Just a modest hut
on the coast In the dusk of Autumn nightfall - Fujiwara no Teika (1162-1241)