STINNER Victor added the comment: Patch version 6: I inlined PyFunction_GetSpecializedCode() into fast_function() of Python/ceval.c. It reduces *a little bit* the overhead of the patch when specialization is not used, but it also avoids to expose this function. I don't think that it's worth to expose PyFunction_GetSpecializedCode(): it was only used in ceval.c. For example, I don't use it for unit tests. I prefer to write tests calling the function and checking the results (see test_pep510.py).
*Raw* overhead of specialized-6.patch on calling "def f(): pass": 1.7 nanoseconds. I computed the overhead using timeit: ./python -m timeit -s 'def f(): pass' 'f()' * Original: 71.7 ns * specialize-6.patch: 73.4 ns (+1.7 ns, +2.4%) * specialize-5.patch: 74.3 ns (+2.6 ns, +3.6%) I will run perf.py to see the overhead on a macro benchmark. ---------- Added file: http://bugs.python.org/file41786/specialize-6.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26098> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com