bpo-30156: Remove property_descr_get() hack by vstinner · Pull Request #3985 · python/cpython

Skip to content

Navigation Menu

Sign in

Appearance settings

Conversation

Remove the cached tuple which caused crashed, use
_PyObject_FastCall() instead.

Microbenchmark using:

    ./python -m perf timeit
        -s 'import collections;P=collections.namedtuple("P","x y");p=P(1, 2)'
        'p.x'

[ref] 80.4 ns +- 3.3 ns -> [fastcall] 103 ns +- 5 ns: 1.28x slower (+28%)

Labels