Don't freeze code objects #414
markshannon
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Definitely worth an experiment. The simplest experiment would be to revert back to just frozen objects, which is marshalled objects (but doesn't have compact bytecode, just unspecialized). Designing a more compact instruction stream format could be a separate experiment (to be timed using PYC files). |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Code objects are immutable in Python, but the underlying memory is mutated a lot.
Consequently we have various workarounds fixing things up at startup and closedown and don't save much time at startup.
It might be better to deepfreeze the marshal data, rather than the code object.
That way, the marshal data can be marked
const
.We can use a more compact form of the bytecode in the marshal format, and generate the adaptive form when marshaling.
This should simplify a number of things, and may well be faster.
Beta Was this translation helpful? Give feedback.
All reactions