Performance

Performance is one of the tent poles of aws-lite. We take it seriously because we want your applications to be as fast possible.

As such, we regularly test and publish open, reproducible, real-world metrics for every key aspect of performance, comparing aws-lite to AWS’s own aws-sdk (v2) and @aws-sdk (v3). Learn more and view source at the aws-lite performance project on GitHub.

All metrics are published below (or skip straight to the wrap-up).

Methodology

In addition to publishing our source, raw data, and final results, we believe it’s important to share the details of our performance testing methodology, too. Learn more here.


Stats last updated: 2024-05-20T01:42:09.390Z

Coldstart latency

Coldstart latency measures the impact of each SDK on AWS Lambda coldstarts – the pre-initialization phase where your code payload is loaded into the Lambda micro VM.

In these stats we expect to see lower values for either very small code payloads (such as aws-lite), or scenarios where we are using the AWS SDK included in the Lambda image (e.g. @aws-sdk v3 raw in nodejs20.x). Coldstart latency increases as code payload sizes increase; this is most clearly observed with bundled SDKs.

Benchmark statistics - Coldstart latency
control aws-lite aws-lite (bundled) aws-sdk (v2) aws-sdk (v2, bundled) @aws-sdk (v3) @aws-sdk (v3, bundled)
mean 118.54 118.35 112.4 126.18 113.79 116.32 120.26
stddev 64.94 37.14 34.53 93.17 25.2 36.77 53.6
p50 102.59 113.09 99.4 109.44 112.05 103.95 104.51
p90 140.7 146.49 143.03 153.02 139.6 139.95 146.38
p95 147.22 153.03 150.39 171.38 142.92 192.87 160.02
p99 255.55 309.27 302.79 304.81 223.04 257.61 367.02

Initialization latency

Initialization latency measures the impact of each SDK on the initialization phase of the Lambda lifecycle, including static analysis and execution of any code outside the scope of the Lambda handler.

Here we expect to see relatively similar values, as the performance benchmark has almost no static code or init-time execution.

Benchmark statistics - Initialization latency
control aws-lite aws-lite (bundled) aws-sdk (v2) aws-sdk (v2, bundled) @aws-sdk (v3) @aws-sdk (v3, bundled)
mean 133.46 150.56 151.7 151.6 133.63 150.92 151.59
stddev 8.52 6.95 11.74 10.21 6.23 9.85 8.83
p50 131.71 149.35 149.74 149.1 132.94 149.71 149.75
p90 141.35 158.67 157.63 160.98 139.95 157.22 160.43
p95 151.78 163.29 164.56 173.54 142.41 171.03 164.12
p99 162.09 173.35 187.62 192.47 155.08 184.92 185.51

Import / require

Here we measure the impact of importing / requiring each SDK. Ideally, all import / require operations should be sub-100ms to ensure fast responses in customer hot-paths.

It is important to note that import / require times are tied to individual services. In this benchmark, only the DynamoDB service client is imported. In real world use your business logic may rely on multiple AWS services – each of which necessitating additional imports, thereby compounding overall response latency.

Benchmark statistics - Import / require
aws-lite aws-lite (bundled) aws-sdk (v2) aws-sdk (v2, bundled) @aws-sdk (v3) @aws-sdk (v3, bundled)
mean 62.5 55.95 249.43 113.77 340.55 308.91
stddev 6.91 5.49 18.02 7.3 27.05 17.83
p50 63 55 245 113 335 306
p90 69 63 267 123 355 324
p95 69 64 275 125 365 336
p99 88 73 300 125 467 369

Instantiate a client

Here we measure the impact of instantiating a new SDK client – a necessary step before making any service API calls. Ideally all operations should be sub-50ms to ensure fast responses in customer hot-paths.

Benchmark statistics - Instantiate a client
aws-lite aws-lite (bundled) aws-sdk (v2) aws-sdk (v2, bundled) @aws-sdk (v3) @aws-sdk (v3, bundled)
mean 7.15 9.41 21.95 21.18 12.03 12.94
stddev 3.99 4.29 4.38 2.99 5.45 6.03
p50 6 6 21 22 8 8
p90 16 16 26 24 18 20
p95 16 17 34 24 18 20
p99 16 18 36 25 19 22

DynamoDB - read one 100KB row

Here we measure the latency associated with reading a single 100KB row from DynamoDB, and parsing and returning results. All reads are identical across SDKs.

Benchmark statistics - DynamoDB - read one 100KB row
aws-lite aws-lite (bundled) aws-sdk (v2) aws-sdk (v2, bundled) @aws-sdk (v3) @aws-sdk (v3, bundled)
mean 126.73 125.27 107.32 174.13 150.06 149.73
stddev 9.54 10.09 10.74 13.56 12.19 11.58
p50 125 124 104 178 148 149
p90 134 133 123 185 159 160
p95 140 138 125 196 174 163
p99 154 158 138 203 195 183

DynamoDB - write one 100KB row

Here we measure the latency associated with writing a single 100KB row into DynamoDB. All writes are identical across SDKs.

Benchmark statistics - DynamoDB - write one 100KB row
aws-lite aws-lite (bundled) aws-sdk (v2) aws-sdk (v2, bundled) @aws-sdk (v3) @aws-sdk (v3, bundled)
mean 24.64 23.3 52 54.55 25.09 31.77
stddev 16.04 13.26 12.05 16.22 14.62 9.71
p50 18 18 50 48 19 30
p90 58 31 62 86 31 37
p95 64 59 69 92 66 41
p99 77 75 102 104 76 73

Peak memory consumption over Lambda baseline

Peak memory consumption measures each SDK’s peak memory usage throughout the above four steps (import / require, instantiation, read, and write).

To make it easier to assess the memory impact of each SDK, the graph is presented as a value over (thus, not including) the Lambda Node.js baseline. Baseline memory consumption would be expected to include Node.js itself, Lambda bootstrap processes, etc. The memory baseline used always corresponds to the equivalent peak memory of the control test (e.g. aws-lite peak memory p95 - control peak memory p95 = peak memory over baseline p95).

Benchmark statistics - Peak memory consumption over Lambda baseline
control aws-lite aws-lite (bundled) aws-sdk (v2) aws-sdk (v2, bundled) @aws-sdk (v3) @aws-sdk (v3, bundled)
mean 68.95 83.44 84.15 79.76 88.21 93.91 99.77
stddev 1.16 1.3 1.58 1.23 1.48 1.59 1.59
p50 68 83 85 79 88 94 100
p90 70 85 85 81 90 96 101
p95 70 85 87 81 90 96 101
p99 72 86 88 81 91 97 102

Time to respond, not including coldstart

Time to respond measures the total execution time of each SDK, not including coldstart or initialization. In real-world usage, Lambda coldstarts are usually less common than warm invocations, so this metric illustrates the most common case for most applications. Ideally all times should be sub-1000ms to ensure fast responses in customer hot-paths.

Benchmark statistics - Time to respond, not including coldstart
control aws-lite aws-lite (bundled) aws-sdk (v2) aws-sdk (v2, bundled) @aws-sdk (v3) @aws-sdk (v3, bundled)
mean 0 227.77 217.1 443.69 372.28 537.33 518.19
stddev 0 22.3 18.17 27.2 19.56 37.89 27.34
p50 0 221 214 439 369 532 513
p90 0 263 244 473 403 558 541
p95 0 272 262 482 405 593 570
p99 0 289 272 508 423 691 608

Total time to respond, including coldstart

Total time to respond measures the total execution time of each SDK, including coldstart or initialization. In real-world usage, this metric represents a normalized “worst case” response time. Ideally all times should be sub-1000ms to ensure fast responses in customer hot-paths.

Benchmark statistics - Total time to respond, including coldstart
control aws-lite aws-lite (bundled) aws-sdk (v2) aws-sdk (v2, bundled) @aws-sdk (v3) @aws-sdk (v3, bundled)
mean 252 496.68 481.2 721.47 619.69 804.57 790.04
stddev 67.63 45.35 41.01 100.69 34.24 56.17 61.38
p50 234 491 468 704 620 787 776
p90 278 544 533 779 654 881 832
p95 299 570 552 813 673 918 900
p99 386 689 638 921 732 1015 1029

Latest data

If you’d like to dig deeper, here’s the data from the latest performance run:

aws-lite is an Apache 2.0-licensed open source project under the umbrella of OpenJS Foundation Architect. aws-lite is not in any way affiliated with Amazon Web Services, Inc. (AWS). All names and trademarks are the property of their respective owners.