4 ms·
It's really about dependencies. An example would be something like data analysis in Python - you want to read some data, do some fairly complex numeric computat
by mcintyre1994 6y ago
It's really about dependencies. An example would be something like data analysis in Python - you want to read some data, do some fairly complex numeric computation on it, write the result out somewhere else. Under some circumstances the Lambda trade-offs might be pretty good here - you might get cold starts of a few seconds but that's still faster than spinning up a new server to run your one time job, and you're not paying to keep servers up all the time.
Some of the libraries you might want to use for that numeric analysis - things like Numpy, Pandas, are pretty large. There's not really a culture of small libraries in Python like a lot of JS libraries, probably because the tradeoffs make less sense the way Python things are traditionally deployed. And there's no concept of tree shaking where dependencies get shrunk to only what you're using either - although maybe you could theoretically make that work on the JS side after transpiling the Python.
But basically, if you have really any common data analysis library from Python you're going to be in that 1-50Mb range, and if you have quite a few you can easily be over 50Mb. That is a workload that sometimes works well as a Lambda, and I'm curious if it's one Cloudflare are thinking about for Workers too.
- AlotOfReading 6y agoI hadn't considered the transpiling case. That seems like a pretty reasonable and common scenario, thanks.