Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading endpoints.json takes a while #748

Closed
stuartleylandcole opened this issue Oct 4, 2018 · 4 comments
Closed

Loading endpoints.json takes a while #748

stuartleylandcole opened this issue Oct 4, 2018 · 4 comments
Labels
2.0 New feature-request A feature should be added or improved.

Comments

@stuartleylandcole
Copy link

Expected Behavior

Creating a service client (e.g. DynamoDbClient could potentially be quicker. Currently, the SDK parses the endpoints.json file into a POJO which takes a reasonable amount of time.

Current Behavior

When building a DynamoDbClient for the first time, the SDK ends up parsing the endpoints.json file into a POJO which takes a reasonable amount of time (the file is approximately 2700 lines long). The code path for this is:

  • software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder.finalizeChildConfiguration(SdkClientConfiguration)
    • software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder.resolveSigningRegion(SdkClientConfiguration)
      • software.amazon.awssdk.regions.ServiceMetadata.of(String)
        • software.amazon.awssdk.regions.internal.RegionMetadataLoader.getServiceMetadata(String) which, if provider is null, calls
          • software.amazon.awssdk.regions.internal.RegionMetadataLoader.build()

Possible Solution

It would be great if the Partitions class could be pre-generated in the SDK so that consumers of it do not need to incur that penalty. There may be good reasons for not doing this, please let me know if so!

Steps to Reproduce (for bugs)

The following code will take you down the code path I highlighted above

DynamoDbClient.builder().build();

Context

I am using the SDK in a Lambda which CRUDs data in a DynamoDB table. The Lambdas provide the API for my client so need to be responsive; creating the DynamoDbClient is by far the slowest part of starting my Lambda (provisioning aside, which I can't control).

Your Environment

  • AWS Java SDK version used: 2.0.0-preview-12
  • JDK version used: 8 (provided by AWS Lambda)
  • Operating System and version: N/A

I would be willing to submit a PR if this functionality is desirable - please give me some pointers if you have a good idea about how it should be implemented.

@spfink
Copy link
Contributor

spfink commented Oct 4, 2018

We are actively working on this and should have a PR out soon!

@stuartleylandcole
Copy link
Author

@spfink that's fantastic! I'm happy to close/for this issue to be closed if you don't need it.

@spfink
Copy link
Contributor

spfink commented Oct 4, 2018

We'll keep this issue around until we have the updated code merged.

@spfink
Copy link
Contributor

spfink commented Oct 23, 2018

Just merged PR #759 that now generates region and service metadata rather than parsing the file at runtime.

@spfink spfink closed this as completed Oct 23, 2018
@justnance justnance added feature-request A feature should be added or improved. and removed Feature Request labels Apr 19, 2019
aws-sdk-java-automation added a commit that referenced this issue Mar 3, 2020
…437eea96

Pull request: release <- staging/f82f336e-daf3-4f40-aa3e-4111437eea96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 New feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

4 participants