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

Closure emit requires in global scope, to have them run in Lambda init phase #11481

Merged
merged 2 commits into from Dec 9, 2022

Conversation

pjoe
Copy link
Contributor

@pjoe pjoe commented Nov 29, 2022

Description

Emit require for importing modules in global scope.
This allows these to run during the init phase of AWS Lambda, where more CPU is available, resulting in greatly imrpoved cold start performance (often 5x or more).

Fixes #11468

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@github-actions
Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@pulumi-bot
Copy link
Contributor

pulumi-bot commented Nov 29, 2022

Changelog

[uncommitted] (2022-11-29)

Features

  • [sdk/nodejs] Emit closure requires in global scope for improved cold start on Lambda

@github-actions
Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@github-actions
Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

Copy link

@PraveenNanda124 PraveenNanda124 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work

@RobbieMcKinstry
Copy link
Contributor

RobbieMcKinstry commented Dec 9, 2022

/run-acceptance-tests
Please view the results of the acceptance tests Here

Copy link
Contributor

@RobbieMcKinstry RobbieMcKinstry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM but I want to get another set of eyes on it.

Copy link
Contributor

@dixler dixler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me. @RobbieMcKinstry

@RobbieMcKinstry RobbieMcKinstry added impact/performance Something is slower than expected language/javascript kind/engineering Work that is not visible to an external user area/callback-functions aka function serialization labels Dec 9, 2022
@RobbieMcKinstry
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 9, 2022

Build succeeded:

@bors bors bot merged commit 78bd0eb into pulumi:master Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/callback-functions aka function serialization impact/performance Something is slower than expected kind/engineering Work that is not visible to an external user language/javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have Lambda function serialization generate require calls outside handler function
5 participants