Just like .NET Core 2.2, AWS Lambda won’t have native support for 3.0 because it’s not an LTS version. Instead, you must use AWS Lambda’s Custom Runtime which is quite easy.

The other big differences with 3.0 are the compile-time options that have been added and changed. The four most interesting options in 3.0 are:

ReadyToRun

R2R is a form of ahead-of-time compilation. It’s off by default, but when enabled, your application assemblies are compiled as ReadyToRun binaries. Microsoft claim this improves startup performance by reducing the amount of work the Just-In-Time (JIT) compiler must do as your application is loading.

IL Trimming

To use 2.2 or 3.0 on Lambda, your deployment package must include the whole .NET runtime which is already pre-installed when running a .NET Core 2.1 Lambda function. As a result, the deployment packages are much bigger. For the function these tests were performed with, the 2.1 package was 890 KB while the 2.2 and 3.0 packages were just over 30 MB each!

It’s off by default, but when enabled, IL Trimming analyzes your application and trims away any unused assemblies. In the test case, it halved the package size down to 16.3 MB!

Tiered Compilation

This was actually added in 2.1, but didn’t really get much attention until the preview stages of 3.0 when it was changed to be enabled by default. I talked about it quite a bit during my previous benchmarks. The idea is that with this enabled, the runtime can get better performance at startup and maximize throughput over time. It theoretically achieves this by compiling your code with fewer optimizations until it detects parts that are being called a lot.

Quick JIT

This is closely related to tiered compilation. Quick JIT makes the compiler apply fewer optimizations to speed up compilation. I’ve listed it separately as it can be turned on and off separately. I believe it’s off by default as it has been since preview 4.