Synthetisation Performance
The faster you can synthesise your CDKTF code, the faster you can deploy it. This page focusse on how to optimise your CDK for Terraform performance.
Typescript
In Typescript the main bottleneck for synthetisation performance is the time it takes ts-node
or tsc
to compile your code.
The easiest way to improve this is using explicit resource imports like import { MyResource } from '@cdktf/provider-my-provider/lib/my-resource'
instead of star imports like import * as myProvider from '@cdktf/provider-my-provider'
.
Another option is to use a bundler without typechecking like tsx
or swc
to compile your code. These are typically a lot faster than tsc
or ts-node
, but you will get no typechecking.
Python
Python is out of the box optimized for synthetisation performance, there a no known steps to improve the synthetisation performance.
Java
To improve the synthetisation performance of Java we recommend using Gradle over Maven. We could observe an improvement for an example using the AWS provider from 3m 30s to 30s after the initial compilation. To migrate to Gradle we recommend creating a new CDKTF project and copying the code over.
C#
C# is out of the box optimized for synthetisation performance, there a no known steps to improve the synthetisation performance.
Go
Go is out of the box optimized for synthetisation performance, there a no known steps to improve the synthetisation performance.