
AWS Lambda Managed Instances with Java 25 and AWS SAM – Part 6 Lambda function performance improvement approaches
Introdcution In part 5 of this series, we measured the initial Lambda function performance (the Java code was intentionally not optimized). Still, we saw a quite noticeable cold start when the request to the Lambda function reached the underlying EC2 instance for the first time. We found that a Lambda function with the Lambda Managed Instances compute type can't eliminate the behavior of the programming language, such as a JVM warm-up period. In this article, we'll optimize our Lambda function to improve the cold start time significantly. Lambda function performance improvement approaches The first thing that we notice during the deployment phase (in case we initially deploy or re-deploy the Lambda function) is that the handler class, for example, for GetProductByIdHandler for the GetProductByIdHandler Lambda function will be initialized. We can prove it by adding some log statements to the static initializer block of this Java class. With this, we know that the static code will be exe
Continue reading on Dev.to
Opens in a new tab



