Repro for aws/aws-cdk#25492
A CDK application which tests cold start latency of lambda functions created with AWS CDK Lambda NodeJsFunction construct.
- Install Node.js by following these steps:
- Install nvm.
- Use node v18.x.x by running
nvm use
ornvm use 18
in a terminal window. - Verify that node is installed by running
node -v
in a terminal window and confirm that it shows Node.js >=18, such asv18.16.0
). - Enable corepack by running
corepack enable
in a terminal window.
- Install dependencies by running
yarn
. - Install the AWS CLI and run aws configure.
- Install
measure-cold-start
serverless application on your AWS Account.
- Run
yarn cdk deploy
deploy this stack to your default AWS account/region. - Run
yarn benchmark
to run the benchmark comparing cold starts between NodejsFunction with Lambda Provided SDK vs Customer Deployed SDK.
$ yarn benchmark --count 1000
{
'NodejsFunction default (uses Lambda Provided SDK)': 1227.1435,
'NodejsFunction custom (uses Customer Deployed SDK)': 929.441
}
- Run
yarn cdk destroy
. - Delete Cloudformation stack with name
serverlessrepo-measure-cold-start
created bymeasure-cold-start
.