4 ms·
> NodeJs is the slowest runtime, after some time it becomes better(JIT?) but still is not good enough. In addition, we see the NodeJS has the worst maximum dura
by bilalq 5y ago
> NodeJs is the slowest runtime, after some time it becomes better(JIT?) but still is not good enough. In addition, we see the NodeJS has the worst maximum duration.
The conclusion drawn about NodeJS performance is flawed due to a quirk of the default settings in the AWS SDK for JS compared to other languages. By default, it opens and closes a TCP connection for each request. That overhead can be greater than the time actually needed to interact with DDB.
I submitted a pull request to fix that configuration[0]. I expect the performance of NodeJS warm starts to look quite a bit better after that.
[0]: https://github.com/Aleksandr-Filichkin/aws-lambda-runtimes-performance/pull/6 https://github.com/Aleksandr-Filichkin/aws-lambda-runtimes-p...
- bilalq 5y agoIn addition, the NodeJS cold start time can be further optimized by bundling into a single file artifact to reduce the amount of disk IO needed when requiring dependencies. Webpack, Parcel, ESBuild, and other bundlers could achieve that, I'm sure. EDIT: That may already be happening here in the build.sh file. I see it runs `sam build --use-container NodeJsFunction -b nodejs`.