pulumi-aws icon indicating copy to clipboard operation
pulumi-aws copied to clipboard

Referencing ec2 package makes Go compiler use excessive RAM

Open t0yv0 opened this issue 1 year ago • 2 comments

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.

t0yv0 avatar Mar 26 '24 13:03 t0yv0

Do you know if that's new or has always been the case? How much is "excessive RAM"?

mikhailshilkov avatar Apr 01 '24 08:04 mikhailshilkov

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.

t0yv0 avatar Apr 02 '24 22:04 t0yv0