# Feature or enhancement Following 6d59c9e, `typing._ProtocolMeta.__instancecheck__` uses `inspect.getattr_static` in a tight loop, where it had previously used `hasattr`. This improves semantics in several highly desirable ways, but causes a considerable slowdown for `_ProtocolMeta.__instancecheck__`, as `inspect.getattr_static` is _much_ slower than `hasattr`. The performance hit to `_ProtocolMeta.__instancecheck__` has already been mostly mitigated through several `typing`-specific optimisations that are tracked in this issue: - https://github.com/python/cpython/issues/74690 However, it would be good to also see if we can improve the performance of `inspect.getattr_static`. This will not only improve the performance of `isinstance()` checks against classes subclassing `typing.Protocol`. It will also improve the performance of all other tools that use `inspect.getattr_static` for introspection without side effects. <!-- gh-linked-prs --> ### Linked PRs * gh-103195 * gh-103318 * gh-103321 * gh-103349 * gh-104267 * gh-104286 * gh-104290 * gh-104320 <!-- /gh-linked-prs -->