[Mono-list] slow HttpWebRequest.BeginGetResponse for Mono

Kriss kriss.sonic at gmail.com
Fri Apr 6 16:55:28 UTC 2012



I am developing a kind of http proxy, which heavily uses the HttpWebRequest
class. I develop on VS and test on 2 virtual machines: one Windows 2008R2
(with .NET4), one Ubuntu 11.10 (with Mono 2.10.5).


While HttpWebRequest.GetResponse is equally fast on both platforms and is
equivalent to HttpWebRequest.BeginGetResponse of .NET4, I observed that
Mono's implementation of HttpWebRequest.BeginGetResponse is much slower, by
an order of 1,5 to 2 times. For a single request, that would be unnoticeable
but for a proxy which keeps calling the method, this becomes an issue and
even lead to timeouts.


I have a test application if you want to reproduce the issue (but it seems
the mailing list do not accept attachment - just email me so that I can send
it to you). Run "HttpWebRequestTest.exe" to use the async mode and
"HttpWebRequestTest.exe false" to run the sync mode. The urls to get and the
number of thread to use may be changed in the .config file. On my two test
machines with the provided list of urls, I get an average of 350ms for
GetResponse (.NET & Mono) and for BeginGetResponse (.NET), but of 600 ms for
BeginGetResponse on Mono.


Does anybody have any idea about what's wrong? 


Best regards


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20120406/6f8296ba/attachment.html>

More information about the Mono-list mailing list