On Wed, Feb 8, 2012 at 12:40 AM, Tom N. <
tai...@gmail.com> wrote:
> I have been playing around with gevent.
> I just recently installed it on my windows machine, Windows 7 64-bit, Python
> 2.7-32 bit version installed.
>
> It seems like in version 1.0b1, monkey.patch_socket() does not seem to work?
>
> Here's my sample code:
https://gist.github.com/1760932>
> If I use monkey.patch_socket(), it seems as if the urllib2 requests are sent
> serially, one after another? It's taking upto ~30 seconds to finish.
> However if I use from gevent import socket, the script finishes in roughly 4
> seconds.
Is it repeatable?
I get this times on my linux machine:
Done in 12.0334970951
Done in 1.68513607979
Done in 1.64854383469
So there's difference between first and the rest.
Unrelated to your issue, but prefer patch_all() to patch_socket(). For
example, https urls would use ssl module and that is not patched by
patch_socket, it patched by patch_ssl. It's easier to just do
patch_all().