Support the use of the managed pre-header in builtin classes.
Open
@markshannon is already working on this.
Since Aug 5, 2022.
3.12
3.13
docs
interpreter-core
performance
type-feature
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Currently Py_TPFLAGS_MANAGED_DICT is an internal-only flag, in fact setting in third-party code is likely to lead to a crash.
We would like to expose it, and a weakref equivalent Py_TPFLAGS_MANAGED_WEAKREFS to allow builtin classes to take advantage of compact object layout.
Compact layout uses less memory, performs better and allow more robust subclassing. So everyone should be able to use it.
- Fix crashes when
Py_TPFLAGS_MANAGED_DICTis used - Add
Py_TPFLAGS_MANAGED_WEAKREFS - Document how to use these flags, and the upgrade path from
tp_dictoffsetandtp_weakreflist
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.