-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Reduce the number of materialized instance __dict__
s
#106485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
performance
Performance or resource usage
Comments
I opened a draft PR for an alternate approach, which aggressively "un-materializes" |
__dict__
in pickle and copy.__dict__
s
brandtbucher
added a commit
that referenced
this issue
Aug 9, 2023
This change seems to be causing crashes on buildbots. See https://buildbot.python.org/all/#/builders/123/builds/813 as example. |
Two more things to fix:
|
markshannon
added a commit
that referenced
this issue
Aug 10, 2023
markshannon
added a commit
that referenced
this issue
Aug 11, 2023
Is there more to do here, or can we close this issue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Accessing the
__dict__
attribute of an object causes the dictionary to be materialized.This has a negative impact on performance.
We should provide means to access the
__dict__
without forcing materialization, which can be used in copy, pickle and any third party code that chooses to.I propose two new methods on
object
:__dict_copy__(self)
, which will be equivalent toself.__dict__.copy()
, but without materializing the dictionary of objects with virtual dictionaries.__dict_update__(self, arg)
, which will be equivalent toself.__dict__.update(arg)
, but without materializing the dictionary of objects with virtual dictionaries.Linked PRs
__dict__
s inLOAD_ATTR_WITH_HINT
#106496__dict__
#107837The text was updated successfully, but these errors were encountered: