Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parenting to a resource chain with many alias combinations slows down SDK execution #10010

Open
Tracked by #11598
mikhailshilkov opened this issue Jun 30, 2022 · 0 comments
Labels
area/sdks Pulumi language SDKs impact/performance Something is slower than expected kind/enhancement Improvements or new features

Comments

@mikhailshilkov
Copy link
Member

Here is a small full repro of the problem in TS:

import * as network from "@pulumi/azure-native/network";
import * as resources from "@pulumi/azure-native/resources";

const resourceGroup = new resources.ResourceGroup("rg");

const virtualNetwork = new network.VirtualNetwork("server-network", {
    resourceGroupName: resourceGroup.name,
    addressSpace: { addressPrefixes: ["10.0.0.0/16"] },
    subnets: [{
        name: "default",
        addressPrefix: "10.0.1.0/24",
    }],
}, {
    parent: resourceGroup,
});

const publicIp = new network.PublicIPAddress("server-ip", {
    resourceGroupName: resourceGroup.name,
    publicIPAllocationMethod: network.IPAllocationMethod.Dynamic,
}, {
    parent: virtualNetwork,
});

It has three resources, each parented to another one, so PublicIPAddress -> VirtualNetwork -> ResourceGroup. Each of these three resource types has a lot of aliases due to multiple Azure version namespaces.

A preview of the program takes 70 seconds on my laptop. Time is mostly spent in the Node.js process. This is due to #8627 - we may want to reconsider that design or find a tradeoff to avoid slowing down cases like the one above.

@mikhailshilkov mikhailshilkov added kind/enhancement Improvements or new features impact/performance Something is slower than expected area/core labels Jun 30, 2022
@mikhailshilkov mikhailshilkov added area/sdks Pulumi language SDKs and removed area/core labels Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sdks Pulumi language SDKs impact/performance Something is slower than expected kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

1 participant