Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use PyObject_TypeCheck in type_call instead of IsSubtype equality test
Summary: In D14351113, the equality check in IsSubtype was introduced as an optimization for the hot path of instance creation. When upstreaming it ([bpo-45697](https://bugs.python.org/issue45697)) it was pointed out that it's preferable to use the `PyObject_TypeCheck` in the hot callsite (which performs an inline equality check before calling to IsSubtype) instead of adding a test to all paths (including those that already use `PyObject_TypeCheck`, hence would hit the equality check twice). This diff ports the [merged upstream PR](python/cpython#29392) to cinder. Test Plan: `make testcinder` passes and sandcastle Reviewers: mpage, carljm, #python_efficiency, #cinder Reviewed By: carljm Subscribers: orvid Differential Revision: https://phabricator.intern.facebook.com/D32175230 Tasks: T104755769 Signature: 32175230:1636152684:21f153f68470c360b16a4a567fa52cb49c375148
- Loading branch information