◐ Shell
clean mode source ↗

GH-87849: Simplify stack effect of SEND and specialize it for generators. by markshannon · Pull Request #101788 · python/cpython

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