-
-
Notifications
You must be signed in to change notification settings - Fork 32k
BUILD_LIST should steal references, similar to BUILD_TUPLE #100146
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
Labels
type-feature
A feature request or enhancement
Comments
lpereira
added a commit
to lpereira/cpython
that referenced
this issue
Dec 9, 2022
When executing the BUILD_LIST opcode, steal the references from the stack, in a manner similar to the BUILD_TUPLE opcode. Implement this by offloading the logic to a new private API, _PyList_FromArraySteal(), that works similarly to _PyTuple_FromArraySteal(). This way, instead of performing multiple stack pointer adjustments while the list is being initialized, the stack is adjusted only once and a fast memory copy operation is performed in one fell swoop.
lpereira
added a commit
to lpereira/cpython
that referenced
this issue
Dec 9, 2022
When executing the BUILD_LIST opcode, steal the references from the stack, in a manner similar to the BUILD_TUPLE opcode. Implement this by offloading the logic to a new private API, _PyList_FromArraySteal(), that works similarly to _PyTuple_FromArraySteal(). This way, instead of performing multiple stack pointer adjustments while the list is being initialized, the stack is adjusted only once and a fast memory copy operation is performed in one fell swoop.
gvanrossum
pushed a commit
that referenced
this issue
Jan 3, 2023
When executing the BUILD_LIST opcode, steal the references from the stack, in a manner similar to the BUILD_TUPLE opcode. Implement this by offloading the logic to a new private API, _PyList_FromArraySteal(), that works similarly to _PyTuple_FromArraySteal(). This way, instead of performing multiple stack pointer adjustments while the list is being initialized, the stack is adjusted only once and a fast memory copy operation is performed in one fell swoop.
Looks like this has been completed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the
BUILD_LIST
opcode adjusts the stack multiple times while items are popped one by one from the stack, rather than employing the more efficient method used byBUILD_TUPLE
(that steals the references from the stack).Linked PRs
The text was updated successfully, but these errors were encountered: