Performance Regressions with Node24 and metadata collection
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
This was opened as a requested here: https://github.com/aws/aws-cdk/issues/36078#issuecomment-3738397539
We saw massive performance regressions with these warnings (ref #36078) and switching from Node 22 to Node 24.
We have a monorepo, and we currently have around ~100 of these warnings. We are on version 2.224.0.
The Node upgrade caused massive slowdowns in cdk synth and cdk deploy.
On Node 24.1.1:
With "@aws-cdk/core:enableAdditionalMetadataCollection": false
cdk synth -v -v --strict 43.73s user 13.47s system 65% cpu 1:27.11 total
With "@aws-cdk/core:enableAdditionalMetadataCollection": true,
cdk synth -v -v --strict 122.27s user 13.58s system 83% cpu 2:43.33 total
We also saw slowdowns on cases without synthesizing (cdk deploy --app cdk.out), going from 4s to 30s.
I don't know certain where is this coming from (IO?), the debug logs are not very useful here.
As a workaround I will keep "@aws-cdk/core:enableAdditionalMetadataCollection" set to false.
### Regression Issue
- [ ] Select this option if this issue appears to be a regression.
### Last Known Working CDK Library Version
_No response_
### Expected Behavior
No massive performance loss on Node24, while having >100 stack warnings
### Current Behavior
The Node upgrade caused massive slowdowns in cdk synth and cdk deploy.
On Node 24.1.1:
With "@aws-cdk/core:enableAdditionalMetadataCollection": false
cdk synth -v -v --strict 43.73s user 13.47s system 65% cpu 1:27.11 total
With "@aws-cdk/core:enableAdditionalMetadataCollection": true,
cdk synth -v -v --strict 122.27s user 13.58s system 83% cpu 2:43.33 total
### Reproduction Steps
Have a repo with >100 warning, use node24.
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### AWS CDK Library version (aws-cdk-lib)
2.224.0
### AWS CDK CLI version
?
### Node.js Version
24
### OS
MacOS
### Language
TypeScript
### Language Version
5.8.3
### Other information
_No response_
Contributor guide
Research direction
Start by reproducing the reported cdk synth and cdk deploy timings on Node 22 and Node 24 with @aws-cdk/core:enableAdditionalMetadataCollection enabled and disabled. Investigate the metadata collection path using the reported reproduction of more than 100 warnings; done means identifying and resolving the Node 24 performance regression without disabling metadata collection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, node.js, typescript
- Domain
- cloud, devops, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100