-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Description
Merging co_names and co_consts would have some significant benefits:
- It would make code objects smaller. There is unlikely to be much sharing between names and constants, but saving two tuples per code object is significant.
- It would free up a register in the interpreter which should be worth a few percent speed up (in the interpreter, less overall).
- By using an array, not a tuple, some lazy initialization of constants becomes possible. For example, a deep-frozen module might not be able to include frozen sets due to hashing; tuples could be stored and converted to frozen-sets on code object initialization.
The obvious downside is for functions where the total number of names and constants exceeds 256. I hypothesize that those functions are rare, but don't have data to confirm that.
This is probably best left until https://bugs.python.org/issue36521 has been resolved.
Metadata
Metadata
Assignees
Labels
No labels