Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Optimize task duration, including parallelism and rate limits

A worked example

Complete the statement

A product-research workflow in Microsoft Foundry starts four agents in parallel. A summary agent starts only after all four have completed. The team captured distributed tracing span data for a typical run, shown in the exhibit. Durations are stable across runs, and orchestration overhead is negligible. The team wants to reduce end-to-end task duration.

SpanStartsDuration (s)
workflow (root)request received13.0
inventory-agentat fan-out4.0
pricing-agentat fan-out11.0
shipping-agentat fan-out7.0
reviews-agentat fan-out3.0
summary-agentafter all four agents complete2.0

Complete the analysis of the trace.

Among the four parallel agents, the critical path runs through the . If that agent's duration is cut to 5 seconds and all other agents' durations remain unchanged, the workflow completes in about .

  • Blank 1: pricing-agent (correct answer)

    The pricing-agent is the slowest parallel agent at 11 seconds, so the summary agent cannot start until it finishes; 11 + 2 matches the 13-second root span. The inventory-agent (4 s), shipping-agent (7 s) and reviews-agent (3 s) finish earlier, so speeding them up would not change the 13-second total.

  • Blank 2: 9 seconds (correct answer)

    With pricing at 5 seconds, the shipping-agent at 7 seconds becomes the slowest parallel agent, and the summary agent then adds 2 seconds: 7 + 2 = 9 seconds. 5 seconds ignores both the new slowest agent and the summary step. 7 seconds finds the new critical path but leaves out the summary agent that runs afterwards. 13 seconds assumes the change has no effect, but pricing was on the critical path.

Why

Tracing spans show which parallel agent finishes last. Here it is the pricing-agent, so it alone sets when the summary step can begin. Optimizing agents that are not on the critical path does not shorten the run. Once pricing drops to 5 seconds, the shipping-agent becomes the slowest of the parallel agents, and the sequential summary step still adds its 2 seconds, so the run takes about 9 seconds.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free