Lazy imports and the art of interpreter procrastination
summary
Python 3.15 adds explicit lazy imports so modules defer loading until first use; at scale an upstream fork (CinderX/Cinder extensions) and rollouts report 12x fewer modules and roughly 70% startup reduction with large memory wins and fewer OOMs. PEP 690 is rejected, PEP 810 (explicit opt‑in syntax) lands. A Rust tool, Lifeguard static analyzer, is used to detect safe laziness. Implementation reifies proxies on first access and pairs with the adaptive interpreter to avoid runtime overhead.
AI-written summary · about
chapters (5)
- 0:00Introduction and background
- 1:53Understanding lazy imports
- 3:58Scale and performance impact
- 5:44History of PEP 690
- 6:04Implementation and adoption
related talks
30mThe Virtues of Being Lazy
27mNo time to idle about: Profiling import time in Python
25mConsistent importing
31mPumping up Python modules using Rust
24mHow two undergrads from the other side of the planet are speeding up...
28mImport Deep Dive
36mPumping up Python modules using Rust
30mImporting Without "import": Behind the Scenes of importlib
