New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove C stack use by specializing BINARY_SUBSCR, STORE_SUBSCR, LOAD_ATTR, and STORE_ATTR #89987
Comments
We can remove the C stack use and general overhead of calling special methods implemented in Python for attribute access and indexing. Each operation has a special method that implements it. When that special method is implemented in Python, we should avoid the
It probably isn't worth bothering with the deletion forms. The getters ( The setters are a bit more complicated as the return value needs to be discarded, so an additional frame which discards the result of the call needs to be inserted. |
Of these, presumably LOAD_GETATTR is by far the most used, so should we try that first? |
I don't think it matter much which we do first. |
That's a good one too, and perhaps simpler. |
This snippet occurs a couple of times in ceval.c (BINARY_SUBSCR_GETITEM and CALL_FUNCTION_PY_SIMPLE):
Maybe I'm reading it wrong, but I think the last line is just setting new_frame->depth++, leaving new_frame->depth = 1 instead of frame->previous->depth + 1. I think the second and third lines should be swapped? |
Is there anything left to do here? |
@markshannon ping? |
The issue and associated PRs have neither activity for one and a half year nor a checklist or a comment stating further work. Thus closing as completed. |
__getitem__
's version for overflow before specializing #30129Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
BINARY_SUBSCR
caches #103022The text was updated successfully, but these errors were encountered: