[Python-Dev] Micro-benchmarks for PEP 580

Victor Stinner vstinner at redhat.com
Tue Jul 10 18:48:13 EDT 2018


About your benchmark results:

"FASTCALL unbound method(obj, 1, two=2): Mean +- std dev: 42.6 ns +- 29.6 ns"

That's a very big standard deviation :-( Are you using CPU pinning and
other technics explaining in my doc?
http://perf.readthedocs.io/en/latest/run_benchmark.html#how-to-get-reproductible-benchmark-results

Victor

2018-07-10 13:53 GMT+02:00 Jeroen Demeyer <J.Demeyer at ugent.be>:
> OK, I tried with --duplicate 200 and you can see the results at
> https://gist.github.com/jdemeyer/f0d63be8f30dc34cc989cd11d43df248
>
> In short, the timings with and without PEP 580 are roughly the same (which
> is to be expected). Interestingly, a small but significant improvement can
> be seen when calling *unbound* methods.
>
> The real improvement comes from supporting a new calling protocol: formerly
> custom classes could only implement tp_call, but now they can use FASTCALL
> just like built-in functions/methods. For this, there is an improvement of
> roughly a factor 1.2 for calls without arguments, 1.6 for calls with
> positional arguments and 2.8 for calls with keywords.
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/vstinner%40redhat.com


More information about the Python-Dev mailing list