Skip to content

Allow full SDK client initialization for newly created clients based on environment variable #2007

Open
@aal80

Description

@aal80

Describe the feature

When creating a new Client object, the client is not fully initialized until the first request is made. It looks like internal components/dependencies are loaded lazily on first client usage. While this might be the desired behavior in some scenarios, this is not always the case. This feature request is for a way to force full client initialization when creating new client objects, preferably using an environment variable.

Use Case

Using the AWS .NET SDK with .NET Lambda functions
When runing a sequence of SDK requests from a Lambda function configured with default settings, it was observed that the first request always takes significantly longer, up to x100 longer in some cases (~2500ms vs ~25ms). This was tested with AmazonDynamoDBClient and AmazonSimpleSystemsManagerClient. The result is a degraded UX for the first function invocation, which is very noticable when developing Lambdas.
image
image

Proposed Solution

Introduce environment variable that will force full client initialization when present.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS .NET SDK and/or Package version used

3.7.3

Targeted .NET Platform

.NET Core 3.1, .NET 6

Operating System and version

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions