The Bakery: How PEP810 sped up my bread operations business
summary
PEP 810 adds an explicit lazy import keyword in Python 3.15 that defers module loading until first use, turning names into lightweight proxies. Applying it to a CLI (uploader demo: breadctl) and measuring with Hyperfine yields concrete wins: a reported 23% faster help command and ~26% module-import reduction in the demo, while large orgs see up to ~70% startup improvements and ~40% memory savings (Meta, HRT, PySide). Caveats: delayed import errors, hidden side effects, and not all modules should be lazy (use selective profiling with import-time counters).
AI-written summary · about
chapters (11)
- 0:00PEP 810 introduction
- 0:49Why PEP 810 matters
- 2:55Performance gains from lazy imports
- 4:00How lazy imports work
- 6:02Live demo and benchmarks
- 9:51Meta and HRT impact
- 11:38Beyond CLI tools
- 13:43Migration guide
- 16:30Pitfalls of lazy imports
- 19:19Implementation status
- 21:06Q&A
related talks
30mThe Virtues of Being Lazy
27mNo time to idle about: Profiling import time in Python
51mTread Lightly When Building and Testing Your Python Project
53mRethinking How We're Linking: What to do when speeding...
29mGet your resources faster, with importlib.resources
51mBuilding useful project utils in Python
26mWhat does PEP 517 mean for packaging
25mPEP 8: How to Avoid Being a Python Hooligan
