-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(core): make creationStack collection for Lazy opt-in #11170
Conversation
The collection of creation stack traces for each instanciation of a `Lazy` object is fairly slow, and retention of the stack traces incurs a significant toll on heap memory usage; especially in contexts where many such instances are created. In order to remove the performance toll of those and remove the impact on heap allocation, while retaining the ability to get access to the stack traces when they are useful (i.e: for debugging a resolution time issue), the stack trace capture is now conditioned to the `CDK_DEBUG` environment variable being set to `'true'`, which can also be set via the new `--debug` argument of the `cdk` command line tool. BREAKING CHANGE: Creation stack traces for `Lazy` values are no longer captured by default. The `CDK_DEBUG=true` environment variable must be set in order to capture stack traces (this is also achieved by using the `--debug` option of the `cdk` CLI). Users should not need those stack traces most of the time, and should only enable creation stack trace captures when tyring to troubleshoot a resolution error that they are otherwise unable to trace back.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Stack trace captured was intended to be disabled by default in #11170. However, due to a logic error that didn't actually happen. This change *actually* disables stack trace capture. BREAKING CHANGE: Creation stack traces for `Lazy` values are no longer captured by default in order to speed up tests. Run with `CDK_DEBUG=true` (or `cdk --debug`) to capture stack traces.
Stack trace captured was intended to be disabled by default in #11170. However, due to a logic error that didn't actually happen. This change *actually* disables stack trace capture. The intent of the original change was to capture *Token* stack traces if and only if `CDK_DEBUG=true` was set. *Metadata* and *Construct* stack traces are managed in the `constructs` library, no longer in CDK. BREAKING CHANGE: Creation stack traces for `Lazy` values are no longer captured by default in order to speed up tests. Run with `CDK_DEBUG=true` (or `cdk --debug`) to capture stack traces. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Stack trace captured was intended to be disabled by default in aws#11170. However, due to a logic error that didn't actually happen. This change *actually* disables stack trace capture. The intent of the original change was to capture *Token* stack traces if and only if `CDK_DEBUG=true` was set. *Metadata* and *Construct* stack traces are managed in the `constructs` library, no longer in CDK. BREAKING CHANGE: Creation stack traces for `Lazy` values are no longer captured by default in order to speed up tests. Run with `CDK_DEBUG=true` (or `cdk --debug`) to capture stack traces. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
The collection of creation stack traces for each instanciation of a
Lazy
object is fairly slow, and retention of the stack traces incurs asignificant toll on heap memory usage; especially in contexts where many
such instances are created.
In order to remove the performance toll of those and remove the impact
on heap allocation, while retaining the ability to get access to the
stack traces when they are useful (i.e: for debugging a resolution time
issue), the stack trace capture is now conditioned to the
CDK_DEBUG
environment variable being set to
'true'
, which can also be set viathe new
--debug
argument of thecdk
command line tool.BREAKING CHANGE: Creation stack traces for
Lazy
values are no longercaptured by default. The
CDK_DEBUG=true
environment variable must beset in order to capture stack traces (this is also achieved by using the
--debug
option of thecdk
CLI). Users should not need those stacktraces most of the time, and should only enable creation stack trace
captures when tyring to troubleshoot a resolution error that they are
otherwise unable to trace back.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license