[pypy-dev] Twisted's deferToThread is much more slower with pypy than on cpython

Nagy, Attila bra at fsn.hu
Mon Jul 18 05:24:38 EDT 2016


Hi,

On 07/17/2016 09:48 AM, Armin Rigo wrote:
> Hi Nagy,
>
> On 3 June 2016 at 09:45, Nagy, Attila <bra at fsn.hu> wrote:
>> Consider this example program:
>> https://gist.github.com/bra-fsn/1fd481b44590a939e849cb9073ba1a41
> I think I fixed this problem in 919e00b3e558 two days ago.  Now it
> seems to always use about 100% CPU and gets performance that is a bit
> better than CPython, instead of spending all its time sleeping.  Yay
> :-)
>
> I did some tests to measure how well PyPy and CPython perform when
> running 2 or 3 threads in various microbenchmark-like situations
> (running pure Python code; acquiring and releasing the same lock;
> ping-pong between two threads; calling a fast or slow C function).
> Now in all measured cases PyPy should perform not too badly.  Actually
> in most cases it was already better than CPython for fairness: for
> example, when one thread runs pure Python code and the other thread
> does many calls to a very fast C function, then CPython gives about
> 0.002% of the time(!) to the second thread and the rest to the first
> one.
>
>
Thank you very much for taking care about this.

You rock. :)


More information about the pypy-dev mailing list