Skip to content

Cache one freed block per size class in pymalloc #159208

Description

@pablogsal

I'd like to try keeping one freed block per size class when it comes from a full pymalloc pool. The next allocation of that size can reuse it without updating the pool's count or adding and removing the pool from a list. Full GC and interpreter cleanup return cached blocks to their pools. Public APIs and allocator hooks stay the same.

Linked PRs

Activity

  1. added
    type-featureA feature request or enhancement
    performancePerformance or resource usage
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions