AWS SDK for Java
Developer Guide

SDK Startup Time Performance Improvement Configuration

Among the improvements in the AWS SDK for Java 2.0 is the SDK startup time for Java functions in Lambda. This is the time it takes for a Java Lambda function to start up and respond to its first request.

Version 2.x includes three changes that contribute to this improvement:

  • Use of jackson-jr, which is a serialization library that improves initialization time.

  • Use of the java.time.libraries for date and time objects.

  • Switch to Slf4j for a logging facade.

You can gain additional SDK startup time improvement by setting specific configuration values on the client builder. They each save some time at startup by reducing the amount of information your application needs to find for initialization.

Note

By specifying these values, you are losing some portability of your code. For example, by specifying an AWS Region, the code will not run in other Regions without modification.

Example: Minimal SDK Startup Time Client Configuration

S3Client client = S3Client.builder() .region(Region.US_WEST_2) .credentialsProvider(EnvironmentVariableCredentialsProvider.create()) .httpClientBuilder(UrlConnectionHttpClient.builder()) .build();