Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.2k
Open
Description
Bug report
There are scaling bottlenecks in the slow paths of_PyType_LookupStackRefAndVersion(), and it turns out that these can be a major bottleneck in larger applications.
For context, I've been testingZulip with 3.14t and multithreading. The problem is basically:
- There are a lot of attribute loads that are not monomorphic (so specialization is of limited help)
- There are lots of unique (type, attr) lookups, so there are frequent collisions in the global MRO cache
The slow path for this case acquires the global type lock.
We should avoid acquiring the global type lock if the type already has a valid version tag. We'll also want to avoid reference count contention on the MRO tuple.