Skip to content

Conversation

@markshannon
Copy link
Member

@markshannon markshannon commented Jan 5, 2022

Specializes calls to "normal" Python classes. That is, classes that inherit from object or other "normal" classes and do not override __new__.

The specialized form creates the object (self) pushes a shim frame to replace the result of __init__ with self and jumps into __init__.

Provides a ~1% speedup

https://bugs.python.org/issue44525

@markshannon
Copy link
Member Author

This needs one or two additional checks that the __init__ function's code object is of the correct form.

@markshannon
Copy link
Member Author

I'm closing this in favor of a two part specialization approach. See faster-cpython/ideas#210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants