logoalt Hacker News

syrusakbarytoday at 7:46 PM1 replyview on HN

Great work from the Cloudflare team!

I was very excited when they first launched Python Workers two years ago. Even though we have competing products at Wasmer, I think Cloudflare work is always exciting and inspiring.

I went back to the feedback I posted in the original launch thread [1]. It's great to see that they have made meaningful progress since then, particularly around package support: PyEmscripten is now standardized through PEP 783.

That said, some of the main architectural concerns I raised at the time are still present:

  * Being tied to use only one version of Python/Pyodide (the one that Workerd embeds)
  * Architecturally tied to the JS/v8 world, which may show some challenges as they aim to reduce cold start times (in my opinion, it will be quite hard for them to achieve <100ms startup time with their current architecture).

In the benchmark we published earlier this year [2], a minimal Python application started in around 60ms on Wasmer Edge versus around 900ms on Cloudflare Workers (backing my concerns from 2024). Those numbers are now several months old, and I hope Cloudflare has improved them significantly since then.

The GA announcement doesn't seem to include updated cold-start numbers. Could someone from the Cloudflare team share the current p50/p95 cold-start times for Python Workers, ideally both with and without native user packages? (for example, one with FastAPI and other without any dependencies).

[1] https://news.ycombinator.com/item?id=39907120

[2] https://wasmer.io/posts/wasm-clouds-the-world-after-containe...


Replies

dom96today at 8:57 PM

(I'm one of the authors of this post)

> Being tied to use only one version of Python/Pyodide (the one that Workerd embeds)

This isn't quite the case, you can choose between different versions using compatibility flags. For example, `python_workers_314` is the compat flag for Python 3.14[1]. You've also got compat flags for 3.13 and 3.12. Though it is worth noting that by using those older versions you will also be using older Pyodide versions too, which have fewer features (for example they lack JSPI support).

> Architecturally tied to the JS/v8 world, which may show some challenges as they aim to reduce cold start times

That is indeed a challenge. But our memory snapshot implementation has improved the cold starts significantly already and we will be working to reduce these even further. We also have sharding these days which reduces cold start frequency a lot. We wrote about cold starts (and sharding) in a previous blog post[2] which includes some numbers.

1 - https://developers.cloudflare.com/workers/configuration/comp...

2 - https://blog.cloudflare.com/python-workers-advancements/

show 1 reply