-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixestopic-free-threading
Description
When reassigning my_obj.__class__ = new_class, we should avoid the stop-the-world pause if the object is uniquely referenced.
Context
I've been profiling a multi-threaded Django server 1 to help find scaling bottlenecks in more realistic applications. Django does a lot of __class__ reassignment (e.g., 1, 2, 3), which with our current strategy causes major scaling bottlenecks. We can skip the stop-the-world pause, if the object is uniquely referenced (i.e., we can guarantee no other thread is accessing it). Together with a few other changes, this improves scaling a lot.
Linked PRs
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixestopic-free-threading