[Python-Dev] PEP 576/579/580 benchmark: mistune
songofacandy at gmail.com
Mon Jul 30 07:11:58 EDT 2018
Like previous SageMath bench, this is caused by Cython's
It specializing calling PyFunction and PyCFunction, but it doesn't
specialized for calling CyFunction.
Cython can optimize both benchmark with binding, but without PEP 576 nor 580,
by adding calling code specialized for CyFunction to __Pyx_PyObject_CallOneArg.
Of course, this specialization doesn't help (1) calling CyFunction from
Python case and (2) calling CyFunction from C case. Please don't attack me
I just survey and report where the overhead in both benchmark with binding=True
in this mail.
I will send another mail about PEP 576 vs 580.
But I'm not good English writer. It's difficult to explain my opinion
on such sensitive
On Fri, Jul 27, 2018 at 10:38 PM Jeroen Demeyer <J.Demeyer at ugent.be> wrote:
> Hello all,
> since my latest benchmark for PEP 580  involved SageMath, which is
> quite a big project, I instead propose a much simpler benchmark
> involving mistune.
> mistune  is a Markdown parser implemented in the Python language. It
> optionally allows Cython compilation. It doesn't use any kind of
> optimization beyond that, but I created a branch  to use extension
> types instead of Python classes.
> Cython can either use built-in functions/methods or a custom class
> (which is not optimized but which would be optimized with PEP 580).
> I benchmarked mistune with custom classes  (binding=True, the
> default) and with built-in functions/methods  (binding=False). This
> is the median time of 5 runs:
> Binding=True: 9.063s
> Binding=False: 8.658s
> So this shows again that PEP 580 improves performance in actual
> real-world use cases.
>  https://mail.python.org/pipermail/python-dev/2018-July/154740.html
>  https://github.com/lepture/mistune
>  https://github.com/jdemeyer/mistune/tree/cython_pxd
>  https://github.com/jdemeyer/mistune/tree/cython_pxd_nobinding
> Python-Dev mailing list
> Python-Dev at python.org
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/songofacandy%40gmail.com
INADA Naoki <songofacandy at gmail.com>
More information about the Python-Dev