Groups | Blog | Home
all groups > dotnet performance > january 2006 >

dotnet performance : HttpWebRequest.GetResponse(); Performance issue



speed32
1/4/2006 8:55:01 PM
The performance of this call is very slow when it is called the first time
within a program. ( 5 - 6 seconds ) However the second time I call this
method is very fast. ( 10 - 40 ms ). It does not matter how long I wait
between subsequent calls it is still fast.

Specifics:

Windows XP x64 with retail version of .net FrameWork 2.0
Web Site is remote but is very responsive. if I call the URL directly from a
Web browser.
The call returns an XML string.

Any help will be appreciated... Code fragement is below.

HttpWebRequest HttpWReq =
(HttpWebRequest)WebRequest.Create("http://somewebsite.htm");
Console.WriteLine("\r\nCall 1.");


HttpWReq.Credentials = CredentialCache.DefaultCredentials;
HttpWReq.MaximumAutomaticRedirections = 4;
HttpWReq.MaximumResponseHeadersLength = 4;
HttpWebResponse HttpWResp =
(HttpWebResponse)HttpWReq.GetResponse();
Console.WriteLine("\r\nCall 2.");
dotnetslackers NO[at]SPAM dejasurf.com
2/11/2006 8:54:51 PM
I have seen this too. Ever figure it out?
---
speed32
2/12/2006 5:04:28 PM
no response frm microsoft. i did monitor the line, sme dhcp traffic
happening.

[quoted text, click to view]
AddThis Social Bookmark Button