-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
3.14bugs and security fixesbugs and security fixesperformancePerformance or resource usagePerformance or resource usage
Description
When the object is pickled by name (classes, functions, and other enum-like objects) has no __module__ attribute or it is None, the code searches the object in all imported modules: tries to resolve its name relatively to the module and check that the result is the same object.
Whether the module was get from the __module__ attribute or found in sys.modules, the code checks it again:
Then it checks again: tries to resolve its name relatively to the module and check that the result is the same object.
So in some the work is repeated twice. The following PR makes it only be performed once. It also contains few other minor optimizations and simplifications.
Linked PRs
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixesperformancePerformance or resource usagePerformance or resource usage
Projects
Status
Done