Why Azure for cloud computing - Performance Analysis
We want to understand how the time to perform cloud tasks with Azure changes as we add more work.
How does Azure handle growing amounts of work efficiently?
Analyze the time complexity of creating multiple Azure virtual machines in a loop.
for i in range(n):
vm = azure.compute.VirtualMachine(
name=f"vm-{i}",
resource_group="myResourceGroup",
location="eastus",
size="Standard_DS1_v2"
)
vm.create()
This code creates n virtual machines one after another in Azure.
Look at what repeats as we create more VMs.
- Primary operation: Creating a virtual machine resource in Azure.
- How many times: Exactly n times, once per VM.
Each new VM adds one more creation operation, so the total work grows directly with n.
| Input Size (n) | Approx. API Calls/Operations |
|---|---|
| 10 | 10 VM creation calls |
| 100 | 100 VM creation calls |
| 1000 | 1000 VM creation calls |
Pattern observation: The work grows steadily and directly with the number of VMs.
Time Complexity: O(n)
This means the time to create VMs grows in a straight line as you add more VMs.
[X] Wrong: "Creating multiple VMs happens all at once, so time stays the same no matter how many VMs."
[OK] Correct: Each VM creation is a separate task that takes time, so more VMs mean more total time.
Understanding how cloud tasks scale helps you explain and design efficient cloud solutions confidently.
What if we created VMs in parallel instead of one after another? How would the time complexity change?