In a recent blog post, Cloudflare outlined the evolution of its Python Workers, including enhancements such as near-instant cold starts, a massive expansion of package compatibility, and a streamlined workflow powered by the popular uv package manager.
One of the challenges with Python has been the startup time, as standard Python runtimes often take several seconds to boot, especially when loading heavy libraries. A respondent on a Hacker News thread captured the community’s frustration:
One of my biggest points of criticism of Python is its slow cold start time. I especially notice this when I use it as a scripting language for CLIs. The startup time of a simple .py script can easily be in the 100 to 300 ms range, whereas a C, Rust, or Go program with the same functionality can start in under 10 ms. This becomes even more frustrating when piping several scripts together, because the accumulated startup latency adds up quickly.
The company introduced a new architecture that utilizes memory snapshots to bypass the initialization phase. Furthermore, WebAssembly (Wasm) powering Python Workers enables this capability by bypassing the need for Address Space Layout Randomization (ASLR), a security feature that typically makes memory snapshotting complex and insecure in native operating systems.
In the blog post, the authors explain that by executing the top-level scope once at deployment and capturing a snapshot of the Wasm linear memory, Cloudflare enables quick Worker restoration, resulting in speed gains. The company states that heavy packages like fastapi and pydantic now load in about 1 second, down from nearly 10 seconds. Additionally, the company´s benchmarks show that Python Workers start 2.4 times faster than AWS Lambda (without SnapStart) and 3 times faster than Google Cloud Run.
In addition, Cloudflare also moved away from a limited set of pre-installed libraries to a broad, open ecosystem. The Python Workers now support any package compatible with Pyodide, including pure Python libraries and many that rely on dynamic C extensions (such as NumPy, Pandas, and Pillow).
To manage this, Cloudflare introduced pywrangler, a new CLI tool integrated with uv, the high-performance Python package manager, which allows developers to manage dependencies via a standard pyproject.toml file, with the tool automatically handling the complexities of bundling compatible modules for the edge.
The update also brings Python into Cloudflare’s more advanced features, including:
- FastAPI Integration: Developers can now deploy full FastAPI applications globally in under two minutes.
- Agentic AI & Workflows: Python Workers are now integrated with Cloudflare Workflows (currently in beta), enabling multi-step, durable execution, as reported earlier by InfoQ as a significant benefit for data and AI pipelines.
- Durable Objects & WebSockets: Python developers can now build stateful applications, such as real-time chat rooms or data consumers, directly on the edge.
By treating Python as a “first-class citizen” alongside JavaScript, Cloudflare is positioning itself as the go-to platform for the growing AI and data science community. The move effectively removes the “latency tax” usually associated with Python in serverless environments, making it a viable choice for performance-critical production apps.
As Dominik Picheta and the Cloudflare team noted:
A cold start is far more expensive in Python than in JavaScript… our aims are high, and we are planning for a future with zero cold start.
Lastly, for developers who want to experiment with Python, Workers are currently available on the Cloudflare Free tier, offering 100,000 requests per day.
