S
sternr
Hey,
I use HttpWebRequest to poll data from a local web page using the GET
mechanism, but no matter how fast or small my request is, the time it
takes to create and get the response is always at least 200-ms even
from my local (localhost) development server!!!
Here's a code sample:
string fullUrl = "http://localhost/getData?id=2";
HttpWebRequest request = HttpWebRequest.Create(fullUrl) as
HttpWebRequest;
request.Method = "GET";
WebResponse res = request.GetResponse();
StreamReader reader = new StreamReader(res.GetResponseStream());
string result = reader.ReadToEnd();
reader.Close();
reader.Dispose();
res.Close();
return result;
I'm using .Net 3.5, and the webserver is based on Python CGI libraries
(GAE), and according to its console the processing time for each
request takes a maximum of 30 ms.
Are there any performance tweaks necessary for the HttpWebRequest?
Why is the overhead that big?
Any help?
Thanks ahead
--sternr
I use HttpWebRequest to poll data from a local web page using the GET
mechanism, but no matter how fast or small my request is, the time it
takes to create and get the response is always at least 200-ms even
from my local (localhost) development server!!!
Here's a code sample:
string fullUrl = "http://localhost/getData?id=2";
HttpWebRequest request = HttpWebRequest.Create(fullUrl) as
HttpWebRequest;
request.Method = "GET";
WebResponse res = request.GetResponse();
StreamReader reader = new StreamReader(res.GetResponseStream());
string result = reader.ReadToEnd();
reader.Close();
reader.Dispose();
res.Close();
return result;
I'm using .Net 3.5, and the webserver is based on Python CGI libraries
(GAE), and according to its console the processing time for each
request takes a maximum of 30 ms.
Are there any performance tweaks necessary for the HttpWebRequest?
Why is the overhead that big?
Any help?
Thanks ahead
--sternr