[Stackless] Stackless Python problem. Help respectfully Requested.
Bob Ippolito
bob at redivi.com
Sat Jul 15 19:38:26 CEST 2006
On Jul 15, 2006, at 3:55 AM, Kusanagi wrote:
> Attached is a file name 's.py' please use it from a command prompt
> for the time data.
>
> Hi All !
>
> I have a little piece of code i.e. 's.py' that contains to
> methods to download webpage a stackless and a non-stackless method.
> The problem that I am having is that I can not see a speed increase
> from the old method to the new.
>
> I would really appreciate anyone that is willing to look over
> my code and tell me what I am doing wrong. I could be nuts thinking
> that I can get anymore speed out of the function that I am calling,
> but hey I program, so I am already nuts, a little more speed never
> hurts, well that's my opinion at least.
>
> What I am trying to do is simple, well at least I think it is.
>
> The old function is called once and does its 'thing' and then
> it is called again with a new set of variables. This is of course
> going to be slow.
>
> What I want is a series of tasklets that creates several copies
> of the same function and completes faster.
>
What you want is not going to happen. Neither method is actually
stackless, they both block all execution on socket IO. Since there
aren't even any schedule calls in any of the urllib stack, it won't
even try and do anything at all in "parallel".
Basically, the stackless version of your code is just more
complicated and slower, it does the same exact thing (though maybe in
a different order, I didn't look very closely).
You need networking code that understands stackless. Such a package
doesn't publicly exist to my knowledge. You can however do this task
in Twisted, and you would get the benefits of parallel requests.
-bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20060715/69ed306f/attachment.htm>
-------------- next part --------------
_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless
More information about the Stackless
mailing list