aws-cdk
aws-cdk copied to clipboard
fix: large amounts of stacks slows down synthesis
A large amount of stacks leads to a large body of metadata into the manifest.json file. The file can grow too large to be written to disk (>512MB), but even if it doesn't fail outright, serializing and writing and loading a large JSON file takes a lot of CPU time.
This PR splits the metadata for stacks off into a separate file which is written separately, moving it out of the hot path of working with the manifest.json file. On a tree of 256 stacks and ~40,000
constructs, this shaves off 5 seconds off of the total synthesis time.
Also in this PR: construct tree iteration was being done in a lot of places, with function recursion and returning arrays. Moving this all into some functions that use generators. This improves performance only slightly, but it should improve memory usage by a whole lot for large construct trees.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
AWS CodeBuild CI Report
- CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
- Commit ID: f04ec71fef374f6307c6172f490e84b5df2eed27
- Result: FAILED
- Build Logs (available for 30 days)
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository