2020-05-19 02:35:11 +02:00
|
|
|
package hcl2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2021-03-17 14:20:05 +01:00
|
|
|
"github.com/pulumi/pulumi/pkg/v3/codegen/internal/test"
|
|
|
|
"github.com/pulumi/pulumi/pkg/v3/codegen/schema"
|
|
|
|
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
|
2020-05-19 02:35:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func BenchmarkLoadPackage(b *testing.B) {
|
2020-07-07 23:45:18 +02:00
|
|
|
loader := schema.NewPluginLoader(test.NewHost(testdataPath))
|
2020-05-19 02:35:11 +02:00
|
|
|
|
|
|
|
for n := 0; n < b.N; n++ {
|
2020-07-07 23:45:18 +02:00
|
|
|
_, err := NewPackageCache().loadPackageSchema(loader, "aws")
|
2020-05-19 02:35:11 +02:00
|
|
|
contract.AssertNoError(err)
|
|
|
|
}
|
|
|
|
}
|