diff options
| author | Victor Stinner <vstinner@redhat.com> | 2018-10-01 10:03:22 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-01 10:03:22 (GMT) |
| commit | e972c13624c32d0efdceb08ff83917fb6b488525 (patch) | |
| tree | b29476556514fcb9092547df2cdc7d4e29712a20 /Lib/test/test_asyncio/utils.py | |
| parent | 9df100286b35f1f9fa85976d573981f558805b3f (diff) | |
| download | cpython-e972c13624c32d0efdceb08ff83917fb6b488525.zip cpython-e972c13624c32d0efdceb08ff83917fb6b488525.tar.gz cpython-e972c13624c32d0efdceb08ff83917fb6b488525.tar.bz2 | |
bpo-30156: Remove property_descr_get() optimization (GH-9541)
property_descr_get() uses a "cached" tuple to optimize function
calls. But this tuple can be discovered in debug mode with
sys.getobjects(). Remove the optimization, it's not really worth it
and it causes 3 different crashes last years.
Microbenchmark:
./python -m perf timeit -v \
-s "from collections import namedtuple; P = namedtuple('P', 'x y'); p = P(1, 2)" \
--duplicate 1024 "p.x"
Result:
Mean +- std dev: [ref] 32.8 ns +- 0.8 ns -> [patch] 40.4 ns +- 1.3 ns: 1.23x slower (+23%)
Diffstat (limited to 'Lib/test/test_asyncio/utils.py')
0 files changed, 0 insertions, 0 deletions
