Add free list optimization for generators/co-routines

Open
#101,140 0 comments 0 reactions 1 assignee View on GitHub

@DinoV is already working on this.

Since Jan 20, 2023.

Assessment

This issue has not been assessed yet.

Description

interpreter-core performance type-feature

Feature or enhancement

Currently generators and co-routines are allocated using the typical allocation strategy and don't include a free list like some other commonly used data structures. In async programs co-routines are heavily allocated and adding a free list can greatly speed things up.

Pitch

At Instagram we see a .25% - .46% perf improvement by having a free list across our entire web server workload.

Linked PRs
  • gh-101142
Dominant language
Python
Stars
77.2k
Forks
36k
Avg merge
1d 9h
Merged PRs (30d)
558

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python/cpython

All issues in python/cpython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.