[UPDATE: You can now read our AWS Lambda and Node.js 12: Support and Benchmark here)

Node.js 10 brings some difference in the runtime and the SDKs compares to Node.js 8.10:

Name Identifier Node.js Version AWS SDK for JavaScript Operating System Node.js 10 nodejs10.x 10.15 2.437.0 Amazon Linux 2 Node.js 8.10 nodejs8.10 8.10 2.290.0 Amazon Linux

Node.js 10 vs Node.js 8

The most notable differences between the versions are:

Performance improvements with V8 Engine v6.6 – Node is powered by the V8 JavaScript Engine (used in Chromium), and Node.js v10 comes with the latest release. Benchmarks show the V8 Engine v6.6 which ships with Chrome 66 provide a reduction of around 20–40% in both parse and compilation time. Adding Error Codes – Errors in Node have now been standardized to have consistent codes with a repeatable pattern. N-API is no longer experimental. Native Node HTTP/2 becomes stable. Upgrade to OpenSSL version 1.1.0.

Performance comparison

At Epsagon, we already support the latest version in the tracing library, and as always – we love to benchmark and compare between different runtimes. We conducted the test on a 128MB Lambda, with the following simple snippet:

exports.handler = async (event) => { const response = { statusCode: 200, body: JSON.stringify('Hello from Lambda!'), }; return response; };

We measured both the cold starts and the avg. duration of the function, using artillery, over a period of an hour. The results were a bit surprising:

It seems that v10 is performing worse both in the average cold start duration and the general average duration for the response. This, however, might happen due to the fact it’s still new.

AWS Lambda, Node.js and much more in our blog:

AWS Lambda and Secret Management

Building a Serverless App Using Athena and AWS Lambda

How to Free AWS Lambda Code Storage

AWS Lambda and Express – Getting Started Guide