-
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
(aws-cdk-lib): Slow Python import times #21695
Comments
Sorry about the length of time this takes,
Which imports do you think are unnecessary? |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
More details here: aws/jsii#3389 (comment) |
Thanks for linking this issue, this is a jsii issue so that existing issue will be the best place to track this. Thanks again |
|
We are just now starting to use CDK v2 after years of using v1 and the workflow is abysmally slow. AWS-CDK developers really need to re-think if packaging everything makes sense. Almost half a year later and no solution in sight, we are now forced to re-consider using terraform. Sorry for venting but I wonder how this slowness is not problematic for most python developers, assuming there were enough testers involved during aws-cdk v2 development. |
Describe the bug
import aws_cdk
takes a long time.Expected Behavior
I expected importing to take less than 2s.
Comparisons:
python -c 'import boto3'
takes ~200ms.node -e 'require("aws-cdk-lib")'
takes ~850ms.Current Behavior
python -c 'import aws_cdk'
takes 5s.Reproduction Steps
Possible Solution
Remove the dozens of imports from
__init__.py
, most of which are unnecessary for most users.Additional Information/Context
This makes even the simplest commands like
cdk list
bizarrely slow even for small projects.CDK CLI Version
2.37.0
Framework Version
No response
Node.js Version
18
OS
Ubuntu 20.04
Language
Python
Language Version
Python 3.8
Other information
No response
The text was updated successfully, but these errors were encountered: