pulumi/pkg
Pat Gavlin 80d35758d5
[codegen/pcl] Allocate fewer type instances. (#7548)
When converting a `schema.InputType` to a `model.Type`, calculate the
resolved form of the type in the schema type system rather than the
model type system. The results are semantically identical, but the
number of type objects that are allocated is much smaller b/c
`model.NewOutputType` no longer allocates.

This deserves a little more explanation.

In order to prevent nested outputs and/or promises, `model.NewOutputType`
calculates the resolved form of its argument prior to allocating a new
`OutputType` value. Calculating the resolved form of the argument is a
no-op if the argument is already fully resolved. Therefore, passing in a
fully-resolved schema type prevents `model.NewOutputType` from
calulating the resolved form, and `model.NewOutputType` will only
allocate the `OutputType` itself instead of the `OutputType` and the
resolved form of any eventuals present in its argument.

This has a _very important_ knock-on benefit: the schema -> model type
translator ensures that given a `schema.Type` instance `T` it will
always return the same `model.Type` instance `U`. This termendously
speeds up type equality checks for complex types, as they will now be
referentially identical.

This change alone gives a significant speedup in azure-native code
generation.
2021-07-16 07:49:24 -07:00
..
backend Fix watch command in macos arm64 builds (#7345) 2021-06-21 14:33:30 -07:00
cmd/pulumi Fix typo: genrated->generated (#7478) 2021-07-12 13:44:09 -07:00
codegen [codegen/pcl] Allocate fewer type instances. (#7548) 2021-07-16 07:49:24 -07:00
engine Add methods lifecycle tests (#7488) 2021-07-12 15:51:11 -07:00
graph [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
operations [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
resource Fix rendering of diffs for resource without DetailedDiffs (#7500) 2021-07-13 08:39:48 -06:00
secrets [cli] Prevent regression in loading passphrase secrets provider from state (#6976) 2021-05-06 14:40:44 +01:00
testing/integration Tracing enhancements for CLI perf metrics capture (#7279) 2021-06-15 13:25:03 -04:00
util [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
go.mod [codegen/schema] YAML {un,}marshaling support. (#7509) 2021-07-13 16:41:40 -07:00
go.sum Add a convert-trace command. (#7319) 2021-06-17 14:46:05 -07:00