Python 3.15 lazy imports cut cold start from 512 ms to 32 ms
Python 3.15.0, released on 9 October, adds explicit lazy imports via PEP 810. In a test on a 2-vCPU container, a health-check handler's cold start dropped from 512 ms to 32 ms, with loaded modules falling from 608 to 57.
- Health-check cold start: 512 ms with eager imports vs 32 ms with lazy import
- Loaded modules dropped from 608 to 57
- X lazy_imports=all gave 23 ms and 53 modules
- The /s3 path improved only from 614 ms to 361 ms since boto3 is still needed
Read next
Software