Per-GIL Interpreter
I remember being very impressed with the React Hooks announcement, this talk had a similar effect on me.
Here, Eric Snow (part of Microsoft’s Faster CPython team), and author of PEP 684 and PEP 554, gave this talk on Python 3.12’s per-interpreter GIL. To make a per-interpreter GIL feature possible, over 4000 shared process globals from CPython first had to be addressed, and over 8 PEPs were ultimately made!
A per-interpreter GIL enables multicore parallelism, matching or outperforming both multithreading and multiprocessing:
- Short-running requests: multithreading definitively outperforms multiprocessing. A per-interpreter GIL outperformed multithreading
- Long-running requests: multiprocessing outperforms multithreading. A per-interpreter GIL equally performed multiprocessing
A per-interpreter GIL will be the fifth method of parallelism in Python
(see Łukasz’s talk for other supported modes).
It’s accessible in Python 3.12 via the third party interpreters
package
and PEP 554 will create a built-in for Python 3.13.
Notes from the talk are available here.