Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eval: parallelize environment loading
These changes add support for loading environments in parallel. Parallelization is breadth-first, then depth-first. For example, given the following environments: ```yaml imports: # env a - b - c -- imports; # env b - e -- imports: # env c - f - g ``` Environments `b` and `c` would be loaded in parallel, then environment `e` would be loaded, then environments `f` and `g` would be loaded in parallel. This simplifies the detection of cyclic imports and the collection of diagnostics. This improves performance for scenarios that are dominated by environment load time (e.g. import graphs with high degrees of fanout). Local benchmark results: goos: darwin goarch: arm64 pkg: github.com/pulumi/esc/eval cpu: Apple M1 Max BenchmarkEval-10 162 6249736 ns/op 4636941 B/op 23697 allocs/op BenchmarkEval-10 192 6229592 ns/op 4637483 B/op 23697 allocs/op BenchmarkEval-10 192 6213844 ns/op 4638117 B/op 23699 allocs/op BenchmarkEval-10 192 6215693 ns/op 4637189 B/op 23696 allocs/op BenchmarkEval-10 192 6286186 ns/op 4637032 B/op 23696 allocs/op BenchmarkEval-10 192 6250083 ns/op 4637796 B/op 23698 allocs/op BenchmarkEval-10 194 6201700 ns/op 4637262 B/op 23697 allocs/op BenchmarkEval-10 192 6256509 ns/op 4637151 B/op 23697 allocs/op BenchmarkEval-10 193 6220107 ns/op 4638638 B/op 23699 allocs/op BenchmarkEval-10 192 6196454 ns/op 4636411 B/op 23696 allocs/op BenchmarkEvalOpen-10 9 124156394 ns/op 4632673 B/op 23703 allocs/op BenchmarkEvalOpen-10 9 123760278 ns/op 4636146 B/op 23713 allocs/op BenchmarkEvalOpen-10 9 123941329 ns/op 4640512 B/op 23718 allocs/op BenchmarkEvalOpen-10 9 122636315 ns/op 4637026 B/op 23710 allocs/op BenchmarkEvalOpen-10 9 123189880 ns/op 4636938 B/op 23702 allocs/op BenchmarkEvalOpen-10 9 122790926 ns/op 4635157 B/op 23710 allocs/op BenchmarkEvalOpen-10 9 123945481 ns/op 4637705 B/op 23711 allocs/op BenchmarkEvalOpen-10 9 123235093 ns/op 4640275 B/op 23710 allocs/op BenchmarkEvalOpen-10 9 122647329 ns/op 4639136 B/op 23708 allocs/op BenchmarkEvalOpen-10 9 123545866 ns/op 4638529 B/op 23715 allocs/op BenchmarkEvalEnvLoad-10 60 17289035 ns/op 4639187 B/op 23721 allocs/op BenchmarkEvalEnvLoad-10 72 17035170 ns/op 4638442 B/op 23721 allocs/op BenchmarkEvalEnvLoad-10 72 17176440 ns/op 4639614 B/op 23722 allocs/op BenchmarkEvalEnvLoad-10 72 17151064 ns/op 4639322 B/op 23722 allocs/op BenchmarkEvalEnvLoad-10 70 17086652 ns/op 4638750 B/op 23719 allocs/op BenchmarkEvalEnvLoad-10 70 16979492 ns/op 4638801 B/op 23721 allocs/op BenchmarkEvalEnvLoad-10 70 17061474 ns/op 4638384 B/op 23720 allocs/op BenchmarkEvalEnvLoad-10 70 17121283 ns/op 4640587 B/op 23723 allocs/op BenchmarkEvalEnvLoad-10 69 17093001 ns/op 4639506 B/op 23722 allocs/op BenchmarkEvalEnvLoad-10 70 17046285 ns/op 4639028 B/op 23720 allocs/op BenchmarkEvalAll-10 8 135173646 ns/op 4635106 B/op 23730 allocs/op BenchmarkEvalAll-10 8 133903672 ns/op 4638396 B/op 23735 allocs/op BenchmarkEvalAll-10 8 133961172 ns/op 4640463 B/op 23735 allocs/op BenchmarkEvalAll-10 8 134953359 ns/op 4639089 B/op 23724 allocs/op BenchmarkEvalAll-10 8 134443724 ns/op 4639118 B/op 23739 allocs/op BenchmarkEvalAll-10 8 134042062 ns/op 4638356 B/op 23733 allocs/op BenchmarkEvalAll-10 8 135336984 ns/op 4642280 B/op 23739 allocs/op BenchmarkEvalAll-10 8 135161682 ns/op 4638414 B/op 23730 allocs/op BenchmarkEvalAll-10 8 133572880 ns/op 4639524 B/op 23727 allocs/op BenchmarkEvalAll-10 8 137661594 ns/op 4642510 B/op 23736 allocs/op
- Loading branch information