Create slice object while unmarshaling instead of runtime as a constant #339
kumaraditya303
started this conversation in
Ideas
Replies: 2 comments
-
See also https://bugs.python.org/issue42454 |
Beta Was this translation helpful? Give feedback.
0 replies
-
and #319 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Take the following code as example:
It creates the following bytecode:
The slice object is created and destroyed almost immediately, although there is a slice cache on the interpreter state but still it is inefficient. Ideally we want this bytecode for slice objects with integers only:
Since
slice
is nothashable
it can marshalled as atuple
of len 3 and since all the indices of slice are integers it will be hashable. It will help in deepfreeze too.Beta Was this translation helpful? Give feedback.
All reactions