Skip to content
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

Add version number to code object, to provide initial version for functions. #446

Closed
markshannon opened this issue Aug 15, 2022 · 1 comment
Labels
3.12 Things we intend to do for 3.12 epic-specialization More specialization work for 3.12

Comments

@markshannon
Copy link
Member

markshannon commented Aug 15, 2022

Calls to nested functions and comprehensions specialize poorly, if at all, because each individual function gets a different version, even though they are essentially the same.

Nested functions can have different defaults, or annotations. However we do not care what either of those are when testing the version. Comprehension functions don't have defaults or annotations.
We just care that the parameters are unchanged and that the number of defaults hasn't changed.

By giving each code object a globally unique id, we can copy that id into the function's version number when the function is created in byteode. All functions with the same code object and number of defaults would have the same version number.

@markshannon
Copy link
Member Author

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 Things we intend to do for 3.12 epic-specialization More specialization work for 3.12
Projects
None yet
Development

No branches or pull requests

1 participant