pulumi-aws
pulumi-aws copied to clipboard
Referencing ec2 package makes Go compiler use excessive RAM
There is a fair number of struts and definitions emitted into the ec2 package, causing issues with the performance of the Go toolchain. The issues come into play for any program that references resources from ec2, which is a lot of programs. We could do better there by removing or moving rarely used definitions to a separate package which will create a separate unit of compilation for Go and reduce RAM requirements. Compiling less will also make programs faster on first start.
Do you know if that's new or has always been the case? How much is "excessive RAM"?
I think I might be misremembering something, we need to measure again.
The investigation started with https://github.com/pulumi/pulumi-cloud-requests/issues/313
And then we found that Go generics was doubling RAM consumption. But RAM consumption was already pretty large. To trigger it you have to have a Go program that references at least 1 resource from the large module. We should try to measure.