Skip to content

gh-159208: Cache one freed block per size class in pymalloc - #159209

Draft
pablogsal wants to merge 1 commit into
python:mainfrom
pablogsal:investigate/pymalloc-20261011
Draft

pablogsal wants to merge 1 commit into
python:mainfrom
pablogsal:investigate/pymalloc-20261011

Conversation

@pablogsal

@pablogsal pablogsal commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Keep one freed block per size class from a full pymalloc pool, so the next allocation can reuse it without pool count or list updates. Clear the cache during full GC and interpreter cleanup, and account for cached blocks in allocator statistics.

Keep full-pool handling in a separate Py_NO_INLINE helper so GCC can inline the ordinary free path. This is an experimental draft.

Closes #159208.

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.

Cache one freed block per size class in pymalloc

1 participant