[docs] [issue24654] PEP 492 - example benchmark doesn't work (TypeError)

Stefan Behnel report at bugs.python.org
Sat Jul 18 10:57:27 CEST 2015


Stefan Behnel added the comment:

Thanks for updating the micro-benchmark. Just FYI (and sorry for hijacking this ticket), I ran it through Cython. Here are the numbers:

Cython 0.23 (latest master)
binary(21) * 3: total 1.609s
abinary(21) * 3: total 1.514s

CPython 3.5 (latest branch)
binary(21) * 3: total 4.653s
abinary(21) * 3: total 4.750s

The low factor between the two shows (IMO) that using a type slot function for await was a very good idea. Streamlining FetchStopIteration might bring another bit.

I also tried the same thing with alternating recursively between the Python and Cython implementation by changing it to

    l = await cy_abinary(n - 1)
    r = await py_abinary(n - 1)

binary(21) * 3: total 3.835s
abinary(21) * 3: total 3.952s

So even the slow fallback paths seem pretty efficient on both sides.

----------
nosy: +scoder

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24654>
_______________________________________


More information about the docs mailing list