# Parallel versus sequential tool calls: waves, the critical path and agent latency

An agent that sends one tool call per model turn pays for every latency and every turn. Sending independent calls together makes each wave last only as long as its slowest call. Change the turn time, edit the trace and watch the speed-up and the critical path.

<div data-sim="specx" data-spec="{&#34;head&#34;:&#34;Parallel versus sequential tool calls: how waves and the critical path set agent latency&#34;,&#34;sub&#34;:&#34;Fifteen tool calls from one research-agent run, grouped into waves of calls that do not depend on each other. Set how long a model turn takes and compare one call per turn with every independent call fired at once.&#34;,&#34;params&#34;:[{&#34;id&#34;:&#34;llm&#34;,&#34;label&#34;:&#34;Model turn time&#34;,&#34;min&#34;:0,&#34;max&#34;:8,&#34;step&#34;:0.1,&#34;value&#34;:2,&#34;unit&#34;:&#34;s&#34;,&#34;note&#34;:&#34;Time for the model to read the results and write the next tool calls&#34;},{&#34;id&#34;:&#34;runs&#34;,&#34;label&#34;:&#34;Agent runs per day&#34;,&#34;min&#34;:1,&#34;max&#34;:5000,&#34;step&#34;:1,&#34;value&#34;:500}],&#34;data&#34;:{&#34;columns&#34;:[&#34;call&#34;,&#34;wave&#34;,&#34;lat_s&#34;],&#34;rows&#34;:[[1,1,1.6],[2,1,1.9],[3,1,2.3],[4,1,0.3],[5,2,2.8],[6,2,3.6],[7,2,2.1],[8,2,4.4],[9,2,1.2],[10,3,0.5],[11,3,5.2],[12,3,0.1],[13,4,0.2],[14,4,7.8],[15,5,0.6]],&#34;note&#34;:&#34;Illustrative research-agent trace in LangSmith or Langfuse style. Calls: 1-3 web search, 4 notes file, 5-8 page fetch, 9 SQL, 10 vector search, 11 code sandbox, 12 calculator, 13 write report, 14 run checks, 15 post summary. wave: dependency level. lat_s: tool latency in seconds.&#34;},&#34;pre&#34;:[{&#34;id&#34;:&#34;ncalls&#34;,&#34;label&#34;:&#34;Tool calls in the run&#34;,&#34;expr&#34;:&#34;count(lat_s)&#34;,&#34;fmt&#34;:&#34;i&#34;},{&#34;id&#34;:&#34;nw&#34;,&#34;label&#34;:&#34;Waves (dependency levels)&#34;,&#34;expr&#34;:&#34;amax(wave)&#34;,&#34;fmt&#34;:&#34;i&#34;}],&#34;row&#34;:[{&#34;id&#34;:&#34;l1&#34;,&#34;label&#34;:&#34;latency if wave 1&#34;,&#34;expr&#34;:&#34;lat_s*ge(wave,1)*ge(1,wave)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;l2&#34;,&#34;label&#34;:&#34;latency if wave 2&#34;,&#34;expr&#34;:&#34;lat_s*ge(wave,2)*ge(2,wave)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;l3&#34;,&#34;label&#34;:&#34;latency if wave 3&#34;,&#34;expr&#34;:&#34;lat_s*ge(wave,3)*ge(3,wave)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;l4&#34;,&#34;label&#34;:&#34;latency if wave 4&#34;,&#34;expr&#34;:&#34;lat_s*ge(wave,4)*ge(4,wave)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;l5&#34;,&#34;label&#34;:&#34;latency if wave 5&#34;,&#34;expr&#34;:&#34;lat_s*ge(wave,5)*ge(5,wave)&#34;,&#34;hide&#34;:true}],&#34;derived&#34;:[{&#34;id&#34;:&#34;m1&#34;,&#34;label&#34;:&#34;Slowest call in wave 1 (s)&#34;,&#34;expr&#34;:&#34;amax(l1)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;m2&#34;,&#34;label&#34;:&#34;Slowest call in wave 2 (s)&#34;,&#34;expr&#34;:&#34;amax(l2)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;m3&#34;,&#34;label&#34;:&#34;Slowest call in wave 3 (s)&#34;,&#34;expr&#34;:&#34;amax(l3)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;m4&#34;,&#34;label&#34;:&#34;Slowest call in wave 4 (s)&#34;,&#34;expr&#34;:&#34;amax(l4)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;m5&#34;,&#34;label&#34;:&#34;Slowest call in wave 5 (s)&#34;,&#34;expr&#34;:&#34;amax(l5)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;s1&#34;,&#34;label&#34;:&#34;Sum of wave 1 (s)&#34;,&#34;expr&#34;:&#34;sum(l1)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;s2&#34;,&#34;label&#34;:&#34;Sum of wave 2 (s)&#34;,&#34;expr&#34;:&#34;sum(l2)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;s3&#34;,&#34;label&#34;:&#34;Sum of wave 3 (s)&#34;,&#34;expr&#34;:&#34;sum(l3)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;s4&#34;,&#34;label&#34;:&#34;Sum of wave 4 (s)&#34;,&#34;expr&#34;:&#34;sum(l4)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;s5&#34;,&#34;label&#34;:&#34;Sum of wave 5 (s)&#34;,&#34;expr&#34;:&#34;sum(l5)&#34;,&#34;hide&#34;:true},{&#34;id&#34;:&#34;sumlat&#34;,&#34;label&#34;:&#34;Tool time, one call after another (s)&#34;,&#34;expr&#34;:&#34;sum(lat_s)&#34;,&#34;tex&#34;:&#34;T_{tools}^{seq} = \\sum_i \\ell_i&#34;},{&#34;id&#34;:&#34;crit&#34;,&#34;label&#34;:&#34;Critical path of the tools (s)&#34;,&#34;expr&#34;:&#34;m1 + m2 + m3 + m4 + m5&#34;,&#34;tex&#34;:&#34;T_{tools}^{par} = \\sum_{w} \\max_{i \\in w} \\ell_i&#34;},{&#34;id&#34;:&#34;tseq&#34;,&#34;label&#34;:&#34;Run time, sequential (s)&#34;,&#34;expr&#34;:&#34;sumlat + (ncalls + 1)*llm&#34;,&#34;tex&#34;:&#34;T_{seq} = \\sum_i \\ell_i + (n+1)\\,t_{llm}&#34;},{&#34;id&#34;:&#34;tpar&#34;,&#34;label&#34;:&#34;Run time, parallel waves (s)&#34;,&#34;expr&#34;:&#34;crit + (nw + 1)*llm&#34;,&#34;tex&#34;:&#34;T_{par} = \\sum_w \\max_{i\\in w}\\ell_i + (W+1)\\,t_{llm}&#34;},{&#34;id&#34;:&#34;speed&#34;,&#34;label&#34;:&#34;Speed-up&#34;,&#34;expr&#34;:&#34;tseq/tpar&#34;,&#34;tex&#34;:&#34;S = \\frac{T_{seq}}{T_{par}}&#34;},{&#34;id&#34;:&#34;cut&#34;,&#34;label&#34;:&#34;Time saved per run&#34;,&#34;expr&#34;:&#34;1 - tpar/tseq&#34;,&#34;fmt&#34;:&#34;p&#34;},{&#34;id&#34;:&#34;par_deg&#34;,&#34;label&#34;:&#34;Average tool concurrency&#34;,&#34;expr&#34;:&#34;sumlat/crit&#34;,&#34;tex&#34;:&#34;\\bar c = \\frac{\\sum_i \\ell_i}{\\sum_w \\max_{i\\in w}\\ell_i}&#34;,&#34;note&#34;:&#34;calls in flight on average while tools run&#34;},{&#34;id&#34;:&#34;hours&#34;,&#34;label&#34;:&#34;Waiting saved per day (h)&#34;,&#34;expr&#34;:&#34;(tseq - tpar)*runs/3600&#34;}],&#34;row2&#34;:[{&#34;id&#34;:&#34;wmax&#34;,&#34;label&#34;:&#34;wave waits (s)&#34;,&#34;expr&#34;:&#34;m1*ge(wave,1)*ge(1,wave) + m2*ge(wave,2)*ge(2,wave) + m3*ge(wave,3)*ge(3,wave) + m4*ge(wave,4)*ge(4,wave) + m5*ge(wave,5)*ge(5,wave)&#34;},{&#34;id&#34;:&#34;slack&#34;,&#34;label&#34;:&#34;idle wait (s)&#34;,&#34;expr&#34;:&#34;wmax - lat_s&#34;,&#34;tex&#34;:&#34;\\text{slack}_i = \\max_{j \\in w(i)} \\ell_j - \\ell_i&#34;}],&#34;post&#34;:[{&#34;id&#34;:&#34;idle&#34;,&#34;label&#34;:&#34;Call time spent waiting for a slower sibling (s)&#34;,&#34;expr&#34;:&#34;sum(slack)&#34;}],&#34;chart&#34;:{&#34;title&#34;:&#34;Each wave lasts as long as its slowest call&#34;,&#34;x&#34;:{&#34;var&#34;:&#34;t&#34;,&#34;label&#34;:&#34;Wave (dependency level)&#34;,&#34;from&#34;:0.5,&#34;to&#34;:5.5},&#34;series&#34;:[{&#34;label&#34;:&#34;Parallel: the slowest call in the wave&#34;,&#34;expr&#34;:&#34;m1*ge(t,0.5)*gt(1.5,t) + m2*ge(t,1.5)*gt(2.5,t) + m3*ge(t,2.5)*gt(3.5,t) + m4*ge(t,3.5)*gt(4.5,t) + m5*ge(t,4.5)*gt(5.5,t)&#34;},{&#34;label&#34;:&#34;Sequential: all calls in the wave added up&#34;,&#34;expr&#34;:&#34;s1*ge(t,0.5)*gt(1.5,t) + s2*ge(t,1.5)*gt(2.5,t) + s3*ge(t,2.5)*gt(3.5,t) + s4*ge(t,3.5)*gt(4.5,t) + s5*ge(t,4.5)*gt(5.5,t)&#34;,&#34;dash&#34;:true}],&#34;points&#34;:{&#34;x&#34;:&#34;wave&#34;,&#34;y&#34;:&#34;lat_s&#34;,&#34;label&#34;:&#34;Each tool call&#39;s latency&#34;}},&#34;level&#34;:&#34;beginner&#34;,&#34;bars&#34;:{&#34;title&#34;:&#34;Seconds each call sits finished, waiting for the slowest call in its wave&#34;,&#34;y&#34;:&#34;slack&#34;,&#34;label&#34;:&#34;call&#34;},&#34;steps&#34;:[{&#34;title&#34;:&#34;Group the calls into waves&#34;,&#34;text&#34;:&#34;The {ncalls} tool calls fall into {nw} waves. Calls in the same wave need nothing from each other, only results from earlier waves, so they can run at the same time.&#34;,&#34;show&#34;:[&#34;ncalls&#34;,&#34;nw&#34;]},{&#34;title&#34;:&#34;Time the sequential run&#34;,&#34;text&#34;:&#34;With one call per model turn, every latency adds up ({sumlat} s of tools) and the model takes a turn before each call and one to answer: {tseq} s in all.&#34;,&#34;show&#34;:[&#34;sumlat&#34;,&#34;tseq&#34;]},{&#34;title&#34;:&#34;Find the critical path&#34;,&#34;text&#34;:&#34;When a wave is sent in one turn, it ends when its slowest call returns. Adding the slowest call of each wave gives the critical path: {crit} s.&#34;,&#34;show&#34;:[&#34;crit&#34;]},{&#34;title&#34;:&#34;Time the parallel run&#34;,&#34;text&#34;:&#34;The model now takes only one turn per wave plus a final answer, so the run takes {tpar} s: a speed-up of {speed} times, or {cut:p} less waiting.&#34;,&#34;show&#34;:[&#34;tpar&#34;,&#34;speed&#34;,&#34;cut&#34;]},{&#34;title&#34;:&#34;Look at the idle time&#34;,&#34;text&#34;:&#34;Fast calls finish early and wait for their slowest sibling: {idle} s of call time in this run. On average {par_deg} calls are in flight while tools run.&#34;,&#34;show&#34;:[&#34;idle&#34;,&#34;par_deg&#34;]},{&#34;title&#34;:&#34;Scale it up&#34;,&#34;text&#34;:&#34;At {runs} runs a day, parallel waves save {hours} hours of waiting. To go further, shorten the critical path: speed up or split the slowest call in each wave.&#34;,&#34;show&#34;:[&#34;hours&#34;]}]}"><p>Interactive simulation. It needs JavaScript; the text below explains what it shows.</p></div>

## What you are looking at

Each row is one tool call from a single run of a research agent: three web searches, a notes file, four page fetches, a SQL query, a vector search, a code sandbox, a calculator, a report file, a checks run and a final post. The `wave` column is the call's dependency level. Wave 1 calls need only the user's question; a wave 2 call needs some result from wave 1, and so on. The last column is the tool's latency in seconds, the kind of number you read off a span in [LangSmith](/tools/langsmith) or [Langfuse](/tools/langfuse).

The chart puts every call at its wave. The solid steps show how long each wave lasts when its calls run together: as long as its slowest call. The dashed steps show the same wave when the calls run one after another: the sum of their latencies. The gap between the two lines is the time parallel calls save. The bars show the idle time of each call: how long it sits finished, waiting for the slowest call in its wave.

## The algorithm

An agent loop alternates two kinds of work: a model turn, where the model reads the latest results and writes the next tool calls, and tool execution. Let n be the number of calls, ℓ_i the latency of call i, W the number of waves and t_llm the time of one model turn.

**Sequential.** With one call per turn, the model takes a turn before every call and one more to write the answer:

T_seq = Σ ℓ_i + (n + 1) × t_llm

**Parallel waves.** If the model emits all the calls of a wave in one response and the runtime executes them concurrently, each wave ends when its slowest call returns. The sum of those maxima is the critical path of the run:

T_par = Σ_w max_(i in w) ℓ_i + (W + 1) × t_llm

**Speed-up and idle time.** The speed-up is S = T_seq / T_par. Each call's slack is the wave's maximum minus its own latency. The ratio of total tool time to the critical path is the average number of calls in flight while tools run.

**Worked example.** With the default 2-second turn, the fifteen calls add up to 34.6 s of tool time. Run one by one with sixteen turns, the agent takes 34.6 + 16 × 2 = 66.6 s. The slowest calls of the five waves are 2.3, 4.4, 5.2, 7.8 and 0.6 s, so the critical path is 20.3 s, and with six turns the parallel run takes 20.3 + 6 × 2 = 32.3 s. That is a speed-up of 2.06 times, or 51.5% less waiting. Fast calls spend 28.4 s in all waiting for slower siblings, and on average 1.70 calls are in flight. At 500 runs a day, the saving is 4.76 hours of waiting.

Notice where the gain comes from: 14.3 s from overlapping tools (34.6 − 20.3) and 20 s from the ten model turns that are no longer needed. When turns are slow, removing turns matters as much as overlapping tools.

## Things to try

- Set the model turn time to 0. Only the tool overlap is left: 34.6 s against 20.3 s, a speed-up of 1.70 times. Raise it to 4 s and the speed-up grows to 2.23 times, because each saved turn is now worth more.
- Change call 8 (the slowest page fetch) from 4.4 to 1.5 s. The parallel run only drops from 32.3 to 31.5 s, because call 6 at 3.6 s becomes the slowest in wave 2. Speed up the slowest call of a wave, but expect the next one to take over.
- Change call 14 (the checks run) from 7.8 to 3.9 s, as if you split the checks into two parallel shards. The critical path falls to 16.4 s and the run to 28.4 s.
- Move call 15 into wave 4 by setting its wave to 4, as if the summary did not need the checks. There are now four waves, the run takes 29.7 s and the speed-up rises to 2.24 times.
- Look at the bars: call 13 waits 7.6 s for call 14. A long call in a wave is a cue to start it earlier or to move cheap work out of its wave.

## How it works in real systems

Both major APIs let the model return several tool calls in one response. In the Claude API, parallel tool use is on by default; you turn it off with `disable_parallel_tool_use: true` inside the `tool_choice` object, and all the `tool_result` blocks must come back together in the next user message. The documentation also suggests a system prompt line asking the model to invoke independent tools simultaneously. In the OpenAI API the model may call several functions in one turn, and setting `parallel_tool_calls` to false limits it to zero or one call (see [function calling](/tools/function-calling)).

Emitting calls together is only half of it: the runtime must also execute them concurrently. The [Claude Agent SDK](/tools/claude-agent-sdk) runs read-only tools such as Read, Glob and Grep concurrently, but runs tools that change state, such as Edit, Write and Bash, one at a time to avoid conflicts. That is the reason for waves: calls that write shared state belong in their own wave even when the model could send them together. In [LangGraph](/tools/langgraph), parallel branches of the graph run in the same super-step for the same effect.

At a larger scale the same idea becomes fan-out. Anthropic reports that its research system has the lead agent start 3 to 5 [sub-agents](/tools/sub-agents) in parallel, each of which uses 3 or more tools in parallel, and that these changes cut research time by up to 90% for complex queries. The price is tokens: Anthropic also reports that multi-agent systems use about 15 times more tokens than chats.

Parallel calls also have limits this model leaves out: rate limits on a shared service (see [retries and backoff](/ai-simulations/tool-call-retries-exponential-backoff)), longer model turns when many results arrive at once, and wasted work when a later result shows an earlier call was not needed. Measure the waves in your own [tracing](/tools/tracing) data, paste them in, and weigh the time saved against your [cost and latency budgets](/tools/cost-and-latency-budgets). The [agent loop token cost](/ai-simulations/agent-loop-token-cost) simulation shows the token side of every extra turn.

## Sources

- [Anthropic Engineering: How we built our multi-agent research system](https://www.anthropic.com/engineering/multi-agent-research-system)
- [Claude API docs: Parallel tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use)
- [OpenAI API docs: Function calling](https://developers.openai.com/api/docs/guides/function-calling)
- [Claude Agent SDK docs: How the agent loop works](https://code.claude.com/docs/en/agent-sdk/agent-loop)
