[CentralOH] Fwd: Re: Stackless Python

Brian Costlow brian.costlow at gmail.com
Mon Nov 2 18:36:44 CET 2009


If you have not read the links I posted yet, read the Beazley slides from
slide 33 to 42, if nothing else.

It's not that you are missing something simple, it's the way python does
threading (or really in a sense, doesn't). In Dave's threading tests,
rewriting some processor-bound code to use 2 threads on one core added over
3 million mach system calls on an OS X box. Running the same code on dual
cores added over 9 million calls and slowed it down even further. There's
your 280%.

I haven't personally done anything with the multiprocessing module, the only
code I have that coordinates multiple processes just forks children
directly, is I/O (network) bound, and since it needs to play nice with other
things, we set it via a config to only use 1/2 the available cores on any
given box. But in general I would expect performance of a processor-bound
app to fall off when you add more processes than you have cores. I don't
know why it falls off a cliff though.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/mailman/private/centraloh/attachments/20091102/3af73942/attachment.htm>

More information about the CentralOH mailing list