Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

To clarify what I mean with:

> - We could also do the same for operations like "some_container[]" if the 
> container is some builtin. We can substitute/specialize the opcode for 
> someone that directly uses built-in operations instead of the generic 
> BINARY_SUBSCR.

If a given function has a BINARY_SUBSCR opcode and when executing it a given 
number of times we see that the object to get the subscript is always a list, 
we change the BINARY_SUBSCR to BINARY_SUBSCR_FOR_LISTS and it that opcode we do 
a quick check for PyList_CheckExact and if is correct we call 
"Objects/listobject.c:list_subscript" directly and if is false we put back a 
BINARY_SUBSCR.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42115>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to