Title: Inline values array into the object · Issue #115776 · python/cpython · GitHub
Open Graph Title: Inline values array into the object · Issue #115776 · python/cpython
X Title: Inline values array into the object · Issue #115776 · python/cpython
Description: Feature or enhancement Currently when allocating a plain Python object, we allocate the object, and its values array. This has a few downsides: We perform two allocations instead of one. An extra indirection is needed when accessing an a...
Open Graph Description: Feature or enhancement Currently when allocating a plain Python object, we allocate the object, and its values array. This has a few downsides: We perform two allocations instead of one. An extra i...
X Description: Feature or enhancement Currently when allocating a plain Python object, we allocate the object, and its values array. This has a few downsides: We perform two allocations instead of one. An extra i...
Opengraph URL: https://github.com/python/cpython/issues/115776
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inline values array into the object","articleBody":"# Feature or enhancement\n\nCurrently when allocating a plain Python object, we allocate the object, and its values array.\nThis has a few downsides:\n1. We perform two allocations instead of one.\n2. An extra indirection is needed when accessing an attribute on the object\n3. If the `__dict__` is materialized we can no longer use specialized lookup.\n\nWe could fix three with an extra pointer in the object header, but that would waste more space.\n\nWe should append the values array directly after the object header, which fixes the above issues.\n\nIt adds some complexity, as we need to track ownership of the values so that they are freed exactly once, but may enable some simplifications as well. Overall, it would seem to make little difference to complexity.\n\nSee https://github.com/faster-cpython/ideas/issues/72 for more discussion.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-116115\n* gh-117673\n* gh-123192\n* gh-128635\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/markshannon","@type":"Person","name":"markshannon"},"datePublished":"2024-02-21T17:02:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/115776/cpython/issues/115776"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aff4ed6f-b36b-f090-220b-52f3f1ef68e2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 91EE:1F26:C358E:157D68:6A4DDA09 |
| html-safe-nonce | f1cdd8e590f801bcd91f12590197d76907c8d44683e8e189359b2219bc849928 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUVFOjFGMjY6QzM1OEU6MTU3RDY4OjZBNEREQTA5IiwidmlzaXRvcl9pZCI6IjgzMDEzMDcwNjYzMDA4ODE0MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f713db5a82b97cb0630ca14cac47dfdae7377a44d4d22bdd2e93783f872121c2 |
| hovercard-subject-tag | issue:2147257868 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/115776/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3c08c2805e8e9016a501c6540289fc7b7b6df8fef006174908dc5d582efb337a/python/cpython/issues/115776 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3c08c2805e8e9016a501c6540289fc7b7b6df8fef006174908dc5d582efb337a/python/cpython/issues/115776 |
| og:image:alt | Feature or enhancement Currently when allocating a plain Python object, we allocate the object, and its values array. This has a few downsides: We perform two allocations instead of one. An extra i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markshannon |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width