You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello.
I'd like to run my app in the various credential setting( i.e. Environment, Web identity, .. )
But credential loading time of aws-sdk v3 fromNodeProviderChain(2 second) is very slower than the aws-sdk v2(0.184ms).
Can I know the reason.? Is there any way to speed up the fromNodeProviderChain?
Credential Loading time for each code
aws-sdk v3 - fromNodeProviderChain : 2014 ms
aws-sdk v2 - AWS.CredentialProviderChain().resolvePromise() : 184 ms
Test environment
node version : v14.21.3
credential setting : Token File with Web Identity
aws-sdk v3 version : 3.398.0
aws-sdk v2 version : 2.1443.0
Test Code
# node -v
v14.21.3
# cat test-aws-v3/test.js
const {fromNodeProviderChain, fromInstanceMetadata} = require("@aws-sdk/credential-providers");
async function main() {
let t1 = Date.now();
let credentialProvider = fromNodeProviderChain();
let credential = await credentialProvider();
let t2 = Date.now()
console.log(t2-t1);
}
main()
# cat test-aws-v2/test.js
var AWS = require('aws-sdk');
async function main() {
let t1, t2;
try {
t1 = Date.now();
const credentials = await new AWS.CredentialProviderChain().resolvePromise();
t2 = Date.now()
console.log('CredentialProviderChain: ', t2-t1);
} catch (e) {console.log(e); }
}
main()
# cat test-aws-v2/package.json
{
"dependencies": {
"aws-sdk": "^2.1443.0"
},
"type": "commonjs"
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello.
I'd like to run my app in the various credential setting( i.e. Environment, Web identity, .. )
But credential loading time of aws-sdk v3 fromNodeProviderChain(2 second) is very slower than the aws-sdk v2(0.184ms).
Can I know the reason.? Is there any way to speed up the fromNodeProviderChain?
Credential Loading time for each code
aws-sdk v3 - fromNodeProviderChain : 2014 ms
aws-sdk v2 - AWS.CredentialProviderChain().resolvePromise() : 184 ms
Test environment
node version : v14.21.3
credential setting : Token File with Web Identity
aws-sdk v3 version : 3.398.0
aws-sdk v2 version : 2.1443.0
Test Code
Beta Was this translation helpful? Give feedback.
All reactions