➜

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.

作者 yselivanov
收信人 gvanrossum, vstinner, yselivanov
日期 2016-09-14.20:48:00
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1473886080.87.0.000411119678127.issue28158@psf.upfronthosting.co.za>
In-reply-to
内容
The attached patch implements an opcode cache for LOAD_GLOBAL opcode, making it 2x faster.

The idea is to use the new co_extra field of code objects & PEP 509 to attach a cache structure pointing directly to the resolved global name.  When globals or builtins are updated, the cache is invalidated.

The patch adds a new file "ceval_cache.h" which provides some infrastructure to ease the pain of implementing new caches for other opcode types.  I can strip down all macros from that file if Victor finds it too hard to review.

Here's a simple script I used to make sure that the cache is working: https://gist.github.com/1st1/a9660aabdcf6b8bc6205b9fe39a82bba

You can also set OPCACHE_COLLECT_STATS to 1 to get debug stats output for the cache.
历史
日期 用户 动作 参数
2016-09-14 20:48:01yselivanov修改recipients: + yselivanov, gvanrossum, vstinner
2016-09-14 20:48:00yselivanov修改messageid: <1473886080.87.0.000411119678127.issue28158@psf.upfronthosting.co.za>
2016-09-14 20:48:00yselivanov链接issue28158 messages
2016-09-14 20:48:00yselivanov创建