M
Mark
Hi...
I've been profiling an HttpListener-based app that takes in POSTed xml of
~150 bytes and returns xml in roughly the 400-byte range.
One of the surprises in the profiling was that the line for reading the
request stream is listed by Quantify as taking about 28% of all the
processing time - the single biggest expense of the transaction, including
the parsing of the xml, processing and sending about 2-3x bytes back.
Here's the code we have for reading in the request:
// get the content of the message
HttpListenerRequest request = context.request;
string body;
using (StreamReader rdr = new StreamReader(request.InputStream,
request.ContentEncoding))
{
body = rdr.ReadToEnd();
}
Any idea why the read would be such a big expense?
Thanks
Mark
I've been profiling an HttpListener-based app that takes in POSTed xml of
~150 bytes and returns xml in roughly the 400-byte range.
One of the surprises in the profiling was that the line for reading the
request stream is listed by Quantify as taking about 28% of all the
processing time - the single biggest expense of the transaction, including
the parsing of the xml, processing and sending about 2-3x bytes back.
Here's the code we have for reading in the request:
// get the content of the message
HttpListenerRequest request = context.request;
string body;
using (StreamReader rdr = new StreamReader(request.InputStream,
request.ContentEncoding))
{
body = rdr.ReadToEnd();
}
Any idea why the read would be such a big expense?
Thanks
Mark