FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-106485: Create object's dict-values instead of creating __dict__, when we can. by markshannon · Pull Request #107843 · python/cpython · GitHub

/ cpython Public

GH-106485: Create object's dict-values instead of creating __dict__, when we can. - #107843

Merged
markshannon merged 2 commits into
python:mainfrom
faster-cpython:always-allocate-value-for-managed-dict-objects
Aug 11, 2023
Merged

markshannon merged 2 commits into
python:mainfrom
faster-cpython:always-allocate-value-for-managed-dict-objects

Conversation

markshannon commented Aug 10, 2023
edited
Loading

Copy link
Copy Markdown
Member

When assigning to an attribute of an object with Py_TPFLAGS_MANAGED_DICT that lacked either a values array or a __dict__,
we currently create a __dict__.
This PR allocates a values array instead.

In an ideal world, we would allocate the values array when we allocate the object.
But that will require better integration of the VM, allocator and GC. So that's for another PR in the future.

markshannon requested a review from methane as a code owner August 10, 2023 14:08
markshannon changed the title Create object's dict-values instead of creating __dict__, when we can. GH-106485: Create object's dict-values instead of creating __dict__, when we can. Aug 10, 2023

Copy link
Copy Markdown
Member Author

Skipping news as this is a strictly internal feature.

Comment thread Objects/object.c Outdated
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
markshannon merged commit 666b68e into python:main Aug 11, 2023
markshannon deleted the always-allocate-value-for-managed-dict-objects branch September 26, 2023 12:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL