bpo-45340: Don't create object dictionaries unless actually needed#28802
bpo-45340: Don't create object dictionaries unless actually needed#28802markshannon merged 25 commits into
Conversation
… keys more freely.
|
Needs NEWS and some additional documentation. |
Sorry, something went wrong.
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Some comments about LOAD_METHOD.
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 7978220 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 8c894f3 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Sorry, something went wrong.
|
The buildbot failures are:
|
Sorry, something went wrong.
A "normal" Python objects is conceptually just a pair of pointers, one to the class, and one to the dictionary.
With shared keys, the dictionary is redundant as it is no more than a pair of pointers, one to the keys and one to the values.
By adding a pointer to the values to the object and fetching the keys via the class, we can avoid creating a dictionary for many objects.
See faster-cpython/ideas#72 for more details.
About 1% faster, which is nice, but the main benefit is the reduced memory consumption.
https://bugs.python.org/issue45340