➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 vstinner
收信人 orent, rhettinger, serhiy.storchaka, vstinner
日期 2018-09-24.15:52:54
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1537804374.68.0.956365154283.issue30156@psf.upfronthosting.co.za>
In-reply-to
内容
PR 9541: my new attempt to remove the micro-optimization. Commit message:

bpo-30156: Remove property_descr_get() optimization

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%)
历史
日期 用户 动作 参数
2018-09-24 15:52:54vstinner修改recipients: + vstinner, rhettinger, orent, serhiy.storchaka
2018-09-24 15:52:54vstinner修改messageid: <1537804374.68.0.956365154283.issue30156@psf.upfronthosting.co.za>
2018-09-24 15:52:54vstinner链接issue30156 messages
2018-09-24 15:52:54vstinner创建