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-04-19T01:37:24.301Z

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 116.63 125.51 116.93 118.92 118.2 120.57 131.42
stddev 26.55 43.99 29.23 28.9 31.96 28.84 81.81
p50 113.9 117.95 112.03 116.25 114.53 115.35 119.39
p90 140.31 149.25 141.28 151.68 142.2 146.95 160.9
p95 150.14 173.71 147.16 162.84 155.1 154.57 187.63
p99 231.06 310.13 236.54 202.54 287.15 235.41 335.45

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 140.56 158.25 157.34 154.39 141.34 159.16 155.33
stddev 8.59 8.51 10.31 13.38 6.71 12.64 6.75
p50 139.06 157.09 156.31 151.97 140.43 156.98 154.67
p90 148.97 165.4 165.77 162.06 149 165.68 161.75
p95 158 168.74 167.43 179.34 153.81 173.61 166.6
p99 171.08 194.98 182.41 212.18 166.19 193.88 178.12

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 63.89 57.14 256.79 118.32 368.38 244.67
stddev 6.22 5.06 30.09 8.27 24.26 13.97
p50 64 56 251 117 365 242
p90 69 64 272 125 389 262
p95 73 65 287 131 397 269
p99 84 69 387 147 474 284

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 8.27 8.9 22.51 24.25 11.24 12.02
stddev 4.4 4.89 5.07 5.3 5.18 5.37
p50 6 6 21 23 7 8
p90 16 17 32 33 18 20
p95 16 18 34 35 18 20
p99 16 20 38 39 20 21

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.99 123.73 109.59 160.58 149.18 144.05
stddev 13.39 9.29 16.18 15.86 23.1 7.93
p50 126 123 104 161 144 144
p90 134 131 121 176 159 153
p95 137 138 131 182 176 159
p99 160 157 177 218 193 160

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 21.33 19.62 56.48 53.28 20.69 24.17
stddev 13.72 12.12 20.98 13.5 9.73 15.23
p50 16 15 50 49 17 18
p90 31 29 81 71 28 44
p95 56 56 94 91 30 67
p99 64 61 127 100 73 71

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.46 82.34 82.47 79.5 85.77 92.78 93.09
stddev 1.69 1.6 1.69 1.76 1.69 1.59 1.59
p50 68 83 82 79 85 93 94
p90 70 84 84 81 87 94 95
p95 71 84 84 83 88 96 96
p99 72 86 85 83 89 96 96

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.37 216.23 457.32 372.53 559.75 438.43
stddev 0 20.65 15.7 53.9 23.93 40.9 25.27
p50 0 222 213 441 365 552 432
p90 0 257 247 495 395 594 474
p95 0 268 252 524 410 635 491
p99 0 284 258 697 477 715 511

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 257.19 511.13 490.5 730.63 632.07 839.48 725.18
stddev 30.14 49.54 37.11 73.74 43.72 56.79 83.01
p50 253 502 484 718 618 826 710
p90 288 560 525 791 674 908 767
p95 306 582 556 875 696 960 806
p99 368 688 598 1015 801 1040 887

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.