You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Make slices marshallable
* Emit slices as constants
* Update Python/marshal.c
Co-authored-by: Peter Bierma <[email protected]>
* Refactor codegen_slice into two functions so it
always has the same net effect
* Fix for free-threaded builds
* Simplify marshal loading of slices
* Only return SUCCESS/ERROR from codegen_slice
---------
Co-authored-by: Mark Shannon <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
…ython#125064)
* Make slices marshallable
* Emit slices as constants
* Update Python/marshal.c
Co-authored-by: Peter Bierma <[email protected]>
* Refactor codegen_slice into two functions so it
always has the same net effect
* Fix for free-threaded builds
* Simplify marshal loading of slices
* Only return SUCCESS/ERROR from codegen_slice
---------
Co-authored-by: Mark Shannon <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
Feature or enhancement
Proposal:
Constant slices are currently emitted as multiple bytecodes by the Python bytecode compiler.
For example,
x[:-2, 1:-1]
generates:Then tuples of slices are constant like this, this could instead be compiled down to a single
LOAD_CONST
instruction:According to @fberlakovich and Stefan Brunthaler's paper on Cross module quickening, this can have a significant impact on Numpy benchmarks.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: