Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-87849: Simplify stack effect of SEND and specialize it for generators. #101788

Merged
merged 6 commits into from
Feb 13, 2023

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Feb 10, 2023

This avoids most the overhead when transferring control from caller to the generator or coroutine in a yield from or await.

The benchmarks results are in the noise, except for the "generators" benchmark which is 2.5x faster.

Mean speedup is about 1%, although that might not be meaningful if one benchmark is 150% faster.

https://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20230210-3.12.0a5%2B-685d559/bm-20230210-linux-x86_64-faster%252dcpython-specialized_send-3.12.0a5%2B-685d559-vs-base.md

@markshannon markshannon merged commit 160f2fe into python:main Feb 13, 2023
carljm added a commit to carljm/cpython that referenced this pull request Feb 13, 2023
* main:
  pythongh-101810: Remove duplicated st_ino calculation (pythonGH-101811)
  pythongh-92547: Purge sqlite3_enable_shared_cache() detection from configure (python#101873)
  pythonGH-100987: Refactor `_PyInterpreterFrame` a bit, to assist generator improvement. (pythonGH-100988)
  pythonGH-87849: Simplify stack effect of SEND and specialize it for generators and coroutines. (pythonGH-101788)
  Correct trivial grammar in reset_mock docs (python#101861)
  pythongh-101845: pyspecific: Fix i18n for availability directive (pythonGH-101846)
  pythongh-89792: Limit test_tools freeze test build parallelism based on the number of cores (python#101841)
  pythongh-85984: Utilize new "winsize" functions from termios in pty tests. (python#101831)
  pythongh-89792: Prevent test_tools from copying 1000M of "source" in freeze test (python#101837)
  Fix typo in test_fstring.py (python#101823)
  pythonGH-101797: allocate `PyExpat_CAPI` capsule on heap (python#101798)
  pythongh-101390: Fix docs for `imporlib.util.LazyLoader.factory` to properly call it a class method (pythonGH-101391)
@erlend-aasland
Copy link
Contributor

FYI: I'm getting a refleak on main for ./python -m test -R : test_capi. Bisecting, it points to this PR.

@markshannon
Copy link
Member Author

#101908

@markshannon markshannon deleted the specialized-send branch September 26, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants