Hey i wanted to know if there is any way to speed ...
# general
h
Hey i wanted to know if there is any way to speed up stack refresh option, i thought if i would give only single resource urn in target would speed up refresh operation. I tried but refreshing stack with or without target takes about same time. Below is the the python console output
Copy code
def with_target(stack, urn):
    start_time = time.time()  # Record the start time
    stack.refresh(target=[urn])
    end_time = time.time()  # Record the end time
    elapsed_time = end_time - start_time
    print(f"Time taken to refresh the stack for URN '{urn}': {elapsed_time:.2f} seconds")
def without_target(stack):
    start_time = time.time()  # Record the start time
    stack.refresh()
    end_time = time.time()  # Record the end time
    elapsed_time = end_time - start_time
    print(f"Without Target : {elapsed_time:.2f} seconds")
with_target(pulumi_service_stack2.stack,'urn:pulumi:pulsar-test-stack-3::pulumi_poc::aws:ec2/instance:Instance::bookie-4')
Time taken to refresh the stack for URN 'urn:pulumi:pulsar-test-stack-3::pulumi_poc::aws:ec2/instance:Instance::bookie-4': 7.78 seconds
without_target(pulumi_service_stack2.stack)
Without Target : 7.38 seconds
So this particular stack has about 15 ec2 resources.