all groups > dotnet performance > october 2004 >
You're in the

dotnet performance

group:

profiling webservice client - horrible results


Re: profiling webservice client - horrible results David Browne
10/21/2004 8:47:19 AM
dotnet performance:
[quoted text, click to view]

Sure you could do alot to reduce memory allocation in this scenario, but you
would loose the ease-of-use of invoking a webservice through a web
reference.

If you want to try it, here's how:

Navigate to the myWebService.asmx page and examine the soap message it
requires. It's just an HTTP request: nothing magical. Cut and paste the
soap message for each method into your code. Then recode your methods to
stream that soap message over a HTTPWebRequest's NetworkStream to the server
and use an XmlReader to read the streaming result and extract the return
values. In all this could be done with very little memory allocation, and
not really too much code, but at the cost of ease of use and maintainence.

David

profiling webservice client - horrible results Ales Pour
10/21/2004 12:03:15 PM
Hello.

I've tried to profile ws client with CLR Profiler and I'm surprised with
results. Calling simple method which echoes string that was sent to it 1000
times causes allocation of 33 MB (ok, not a big deal ;-) ), what is worse
that over 8 MB was rellocated (most of them byte arrays and strings) and gc
for gen 1 was called 42 times. I'm not expert in interpreting the the
profiler results, but it appears to me that most byte arrays that get into
gen 1 are memory chunks of request and response streams.

I wonder if there's a way to improve the performance of ws invocation
(perhaps using own WebRequest/WebReponse and doing some trick in those
subclasses, or anything else)? Thanks!

Regards,
Ales Pour

Re: profiling webservice client - horrible results Ales Pour
10/21/2004 4:05:56 PM
Thanks.

However this is not the trick I was after :-).

What I hoped for was something like ... that since WebRequest/WebResponse
have control over the streams which SoapHttpClientProtocol uses to write a
request to and read a response from, I could release them (and all those
byte chunks behind them) to reduce garbage collecting, rellocations etc.

Best regards,
Ales


[quoted text, click to view]

AddThis Social Bookmark Button