Benchmarking AWS Lambda runtimes in 2021: cold start

  • Java (11)
  • NodeJs (14.x)
  • Python (3.9)
  • Go(1.x)
  • Ruby(2.7)
  • .Net(3.1)
  • Rust(1.54.0)
  • GraalVM(21.2)


Test scenario

We are going to test API-Gateway -> AWS Lambda->DynamoDb flow.

The main flow

Cold start

Firstly we are going to test the cold start(the first invocation on AWS Lambda instance) delay. To measure this metric we will use X-Ray tracing. From my point of view, it's the most honest result, because it includes all steps(init/invocation/overhead).

Cold start result


256 MB, Ruby cold start


256 MB, Python cold start


256 MB, NodeJS cold start


256 MB, Golang cold start


Java with 128 doesn’t work, it has OutOfMemoryError :)

256 MB, Java cold start


256 MB, GraalVM cold start


256 MB, .Net cold start


256 MB, Rust cold start


  • All languages(except Java and .Net) have a pretty small cold start.
  • Java even cannot start with 128Mb. It needs more memory. But GraalVM can help in this case. Feel free to read a detailed page about GraalVM and AWS Lambda
  • Rust beats all runtimes for all setups, the only exception is 128 MB where Python is the best.
  • The huge setup helps only for Java and .Net.

Next test

The warm comparison you can find in the next article.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store