fix(core): default stack trace size adds unnecessary overhead#37827
Conversation
By default, the CDK library captures the largest possible stack trace whenever stack traces are captured. Capturing the default stack trace size (10 frames) configured using `--stack-trace-limit` saves ~50% of the time spent in stack trace collection. This saves ~200ms on ~8500 constructs in one sample application, while leaving the user in control.
|
PRs without a linked issue will receive lower priority for review and merging. Please update the description to follow the PR template and include a line like |
mrgrain
left a comment
There was a problem hiding this comment.
I think this is good, but one question for clarification:
Q: This only happens when --debug is enabled, correct?
Not entirely. Construct creation is always traced, even without |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Merge Queue Status
This pull request spent 47 minutes 28 seconds in the queue, including 47 minutes 2 seconds running CI. Required conditions to merge
|
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
By default, the CDK library captures the largest possible stack trace whenever stack traces are captured. Capturing the default stack trace size (10 frames) configured using
--stack-trace-limitsaves ~50% of the time spent in stack trace collection.This saves ~200ms on ~8500 constructs in one sample application, while leaving the user in control.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license