5 ms·
Preloading functions is a good strategy, but claims of "eliminating cold starts" and "zero overhead" are a bit hyperbolic. I don't know enough about cloudflare
by soamv 6y ago
Preloading functions is a good strategy, but claims of "eliminating cold starts" and "zero overhead" are a bit hyperbolic.
I don't know enough about cloudflare workers, but function cold start latencies are not fully in control of the platform. You can hide the latency of scheduling and loading, but the function might load a ton of dependencies; and it might have its own custom init code that you generally have little control over. So you can hide an SSL handshake's worth of latency, and that's a nice little win, but whether that makes the user-visible cold start latency zero depends on what it was in the first place.
But I'm guessing cloudflare workers are used for relatively simple stuff, so they don't often have dependencies or complex init code.
(And sorry, I don't mean to sound too negative, this stuff is pretty cool!)
- sopromo 6y agoFrom their FAQ about dependencies in this case for js: Can I use npm with Workers? Workers has no explicit support for npm, but you can use any build tool or package manager you need to create your Worker script. Just upload to us the final, built, script with all dependencies included.
- soamv 6y agoRight, you package up your dependencies. That doesn't mean you don't have any! Anyway, what I'm getting at is, the platform has to load a bunch of code, sometimes that will take longer than the latency that you can hide behind an ssl handshake; plus the code might run something on init. But yes, workers seem to be oriented towards relatively small bits of code, so maybe the vast majority of load times are a few ms.
- hinkley 6y agoCorrect me if I'm wrong, but isn't part of the design of QUIC about removing one network roundtrip from the encryption handshake? That gap is going to get a little smaller.
- hinkley 6y agoIt's fastcgi. I can't be the only one seeing this, right? The cover may be better than the original song, but this isn't "All along the Watchtower" or "Feeling Good" as far as I can see.
- lsorber 6y agoAre you sure about that? It depends on how Cloudflare defines what a cold start is. It might well include the initial loading of your code, with imports and init.