4371 shaares
tl;dr:
- AWS Lambda execution environment is a micro virtual machine (or microVM) based on Firecracker
- the init code will execute faster than your handler code
- at 3008 MB [...] the Lambda function handler gets two unthrottled vCPUs
- Conclusion: by following best practices and moving as much code as possible to the Lambda's bootstrap, these functions will run more efficiently (and thus cheaper) in two ways:
- The bootstrap code will only execute once per (hopefully) many Lambda invocations.
- When the bootstrap code gets executed, it will run faster than it would in the handler (for Lambda memory configurations up to 3 GB).