[Python-Dev] frame evaluation API PEP
python at mrabarnett.plus.com
Sun Jun 19 22:14:37 EDT 2016
On 2016-06-20 02:29, Brett Cannon wrote:
> On Sat, 18 Jun 2016 at 21:49 Guido van Rossum <guido at python.org
> <mailto:guido at python.org>> wrote:
> Could you figure out some other way to store per-code-object data?
> It seems you considered this but decided that the co_extra field was
> simpler and faster; I'm basically pushing a little harder on this.
> Of course most of the PEP would disappear without this feature; the
> extra interpreter field is fine.
> Dino and I thought of two potential alternatives, neither of which we
> have taken the time to implement and benchmark. One is to simply have a
> hash table of memory addresses to JIT data that is kept on the JIT side
> of things. Obviously it would be nice to avoid the overhead of a hash
> table lookup on every function call. This also doesn't help minimize
> memory when the code object gets GC'ed.
If you had a flag in co_flags that said whether it should look in the
hash table, then that might reduce the overhead.
More information about the Python-Dev