4 ms·
Dude, you didn't bundle the app or upload a folder with cached contents. This essentially nullifies the entire point of using Deno. It's as if your Node functi
by gavinray 6y ago
Dude, you didn't bundle the app or upload a folder with cached contents. This essentially nullifies the entire point of using Deno.
It's as if your Node function were re-installing all of it's node_modules in package.json each cold-start.
One of the major benefits of Deno is that you can run "deno bundle" which will spider all your imports and deps and create a single JS file that is the JS equivalent of an executable. Giant, 100 dependency app? "deno bundle" gives you "app.js" and just hand it to anyone and they can run it with no further tooling.
Beyond that, I'm not intimately familiar with Lambda's but if they allow multi-file uploads with relative imports, you could have uploaded the cache if you didn't bundle it:
Deno caches remote imports in a special directory specified by the DENO_DIR environment variable. It defaults to the system's cache directory if DENO_DIR is not specified. The next time you run the program, no downloads will be made. If the program hasn't changed, it won't be recompiled either.
- mjb 6y agoDownloading dependencies on cold start not only adds to start latency, but is also an availability risk. You don't want your starts to fail when the package distribution infrastructure is down. Where possible, it's best to include everything your Lambda function needs to run in the function .zip. That means you can take advantage of all the work we do to make the scale-up and cold-start paths of Lambda highly available and reliable. Having said that, it's very cool to see folks using Deno on Lambda, and getting real numbers like this starts an important conversation. (Disclaimer, I work on the Lambda team at AWS)
- dimitrios1 6y agoCan we have Go support for Lambda@Edge please? :)
- muizelaar 6y agoI filed https://github.com/mbonig/node-vs-deno/issues/1 https://github.com/mbonig/node-vs-deno/issues/1
- matthewbonig 6y agothank you for filing, I appreciate the feedback. I've updated the tests to bundle dependencies and it does not make a large improvement to cold-start times and makes no difference in the duration average of warm lambdas. If I missed something and can further optimize, please let me know.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]