mirror of https://github.com/pulumi/pulumi.git
c9c679f0d4
Reviewers should note this PR is in two commits. Updates the progress display to support deterministic output without rendering each in-progress frame, called "plain" output in the tests below. The CLI should now render tree views more consistently: implementing this test required fixing a non-deterministic ordering bug that affected all tree renders. This bug was caused by iterating over a map to determine the row order, however Go does not guarantee a consistent order when iterating over a map. Now insertions into the tree are ordered by URN, which should be deterministic. Benchmarks are added to measure timing and memory usage of progress displays, as we intend to use this rendering mode with Pulumi Copilot. On this laptop the slowest test, `template-body.json`, has its results reported below. The new "plain" output is the fastest by an order of magnitude - and this scaling factor improves as the size of the test grows. While "plain" here is 15 to 20x faster than the other modes, in shorter tests it is only 2 to 4x faster. Peak heap usage and allocations are also reduced by rendering only the last frame, though not as dramatically. ``` goos: linux goarch: amd64 pkg: github.com/pulumi/pulumi/pkg/v3/backend/display cpu: 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz BenchmarkProgressEvents BenchmarkProgressEvents/template-body.jsoninteractive/80x24/raw-8 12 91473186 ns/op 11745682 B/op 223168 allocs/op BenchmarkProgressEvents/template-body.jsoninteractive/80x24/cooked-8 8 134639710 ns/op 16078474 B/op 269443 allocs/op BenchmarkProgressEvents/template-body.jsoninteractive/80x24/plain-8 152 7999863 ns/op 2952236 B/op 52725 allocs/op BenchmarkProgressEvents/template-body.jsoninteractive/100x80/raw-8 8 142099499 ns/op 14636003 B/op 239221 allocs/op BenchmarkProgressEvents/template-body.jsoninteractive/100x80/cooked-8 7 147865799 ns/op 17260515 B/op 275864 allocs/op BenchmarkProgressEvents/template-body.jsoninteractive/100x80/plain-8 147 7874586 ns/op 2960121 B/op 52782 allocs/op BenchmarkProgressEvents/template-body.jsoninteractive/200x80/raw-8 8 128632367 ns/op 14650076 B/op 239220 allocs/op BenchmarkProgressEvents/template-body.jsoninteractive/200x80/cooked-8 7 149342244 ns/op 18052901 B/op 284310 allocs/op BenchmarkProgressEvents/template-body.jsoninteractive/200x80/plain-8 144 7999831 ns/op 2962243 B/op 52784 allocs/op BenchmarkProgressEvents/template-body.jsonnon-interactive-8 178 6662351 ns/op 2877507 B/op 51378 allocs/op ``` Also adds a "ShowResourceChanges" option to the progress display, which when set adds a section showing resource diffs. The updated test data shows examples. This combines the tree view with more detailed information about the changes made, albeit more compactly. This change is intended to be consumed by Pulumi Copilot, and so is not enabled for the CLI at this time. Each commit of this PR implements these features separately. |
||
---|---|---|
.. | ||
json-yaml | ||
not-truncated | ||
truncated | ||
.gitattributes |