aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.97k stars 556 forks source link

chore: statically import credential-provider-node in clients used from credentials #6027

Closed trivikr closed 2 months ago

trivikr commented 2 months ago

Issue

Internal JS-5156

Description

Statically imports @aws-sdk/credential-provider-node in clients used from credentials, i.e. client-sts and client-sso-oidc

This import can be made static, since the credential providers are dynamically imported.

Testing

We benchmarked @aws-sdk/client-sts@v3.556.0 (latest version at the time of PR) getCallerIdentity operation for 100 counts before and after the change.

Before

╔════════════════════════════════════════════╤════════════════════╤═════════╤═════════╤════════╗
║                                            │ metric             │ p50     │ p90     │ stdDev ║
╟────────────────────────────────────────────┼────────────────────┼─────────┼─────────┼────────╢
║ [node 20.12.0, x86_64, 128 MB, us-west-1]: │ init_duration (ms) │ 321.72  │ 338.72  │ 23.71  ║
║ Code (esm) with sts get-caller-identity    │ request (ms)       │ 1183.14 │ 1233.86 │ 100.6  ║
║ v3.556.0 (2.15 MB)                         │                    │         │         │        ║
╚════════════════════════════════════════════╧════════════════════╧═════════╧═════════╧════════╝

After

╔════════════════════════════════════════════╤════════════════════╤════════╤═════════╤════════╗
║                                            │ metric             │ p50    │ p90     │ stdDev ║
╟────────────────────────────────────────────┼────────────────────┼────────┼─────────┼────────╢
║ [node 20.12.0, x86_64, 128 MB, us-west-1]: │ init_duration (ms) │ 319.6  │ 338.82  │ 22.12  ║
║ Code (esm) with sts get-caller-identity    │ request (ms)       │ 982.78 │ 1017.49 │ 90.68  ║
║ v3.556.0 (2.15 MB)                         │                    │        │         │        ║
╚════════════════════════════════════════════╧════════════════════╧════════╧═════════╧════════╝

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

github-actions[bot] commented 1 month ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.