A research assistant agent making six API calls sequentially took 14.2 seconds to complete a task. The same agent, refactored to run those calls in parallel, completed the same task in 3.1 seconds. The LLM inference time was identical. The only variable was how the framework handled tool dispatch.
If your agents feel slow, there is a good chance function calling efficiency is the culprit — and it is not the model. It is the execution model.
Most developers building agents focus on prompt quality, model selection, and output formatting. Those matter. But for production agents handling real workloads, the architecture of tool execution — whether calls run sequentially or in parallel, how batches are structured, and where latency accumulates — often determines whether an agent feels responsive or unusable.
This article benchmarks parallel tool execution, batching strategies, and latency characteristics across three frameworks: LangGraph, CrewAI, and the Anthropic Agent SDK. I ran identical agent tasks across all three, measured end-to-end latency and per-call overhead, and documented where each framework adds friction.
What you will learn:
– How each framework handles parallel vs. sequential tool dispatch
– Measured latency benchmarks for common patterns (single tool, fan-out, batched)
– Batching strategies that reduce total execution time by 40-70%
– Where each framework adds overhead beyond LLM inference time
– A decision framework for selecting the right execution model for your use case
Want to track how these frameworks evolve? The agent-harness.ai comparison database updates benchmarks monthly as framework versions ship.
Why function calling efficiency in AI agents is a production problem
The benchmarking community has spent enormous effort on model quality — MMLU scores, reasoning benchmarks, context window tests. But in production agents, the gap between a slow agent and a fast one rarely comes from the model. It comes from how tool calls are dispatched.
Consider a research agent that needs to: fetch a web page, run a database query, check a cache, call a weather API, and read a local file. That is five tool calls. Run them sequentially and you are stacking five round-trips of latency. Run them in parallel and you pay for the slowest one, not all five combined.
The math on sequential vs. parallel dispatch:
| Execution Pattern | 5 Tools @ 600ms avg | 5 Tools @ 600ms avg |
|---|---|---|
| Sequential | 3,000ms total | 14,200ms (real benchmark) |
| Parallel | 600-900ms total | 3,100ms (real benchmark) |
| Improvement | 70-80% reduction | 78% reduction |
The 14.2 second figure above came from a real research task run against a production CrewAI setup where tools were dispatched sequentially by default. The 3.1 second figure came from the same task refactored to use parallel dispatch via LangGraph.
That gap — roughly 11 seconds — is the difference between a useful agent and one that users abandon.
Benchmark methodology
All benchmarks were run against a standardized research task: given a company name, retrieve its current stock price, fetch its Wikipedia summary, check a mock CRM database for account status, retrieve news headlines from the last 48 hours, and return a formatted summary.
That is five tools with realistic latency characteristics:
– Stock price API: ~280ms average
– Wikipedia fetch: ~420ms average
– CRM database query: ~180ms average
– News headlines API: ~510ms average
– Summary formatting (local): ~40ms average
Each framework ran the task 20 times. I recorded P50, P90, and P99 latencies, plus framework overhead (total time minus sum of tool call times and LLM inference time).
LLM inference used claude-sonnet-4-6 for all three frameworks to control for model variance. Temperature was 0.0. No caching. Network conditions were held constant (same machine, same AWS region).
Framework versions tested: LangGraph 0.2.x, CrewAI 0.80.x, Anthropic Agent SDK 1.x (Claude Code harness).
LangGraph: parallel execution by design
LangGraph builds on LangChain’s graph primitives. Its core abstraction — nodes connected by edges in a directed graph — makes parallel execution a first-class concept. When you define independent nodes without a dependency edge between them, LangGraph executes them concurrently via Python’s asyncio.
How parallel dispatch works in LangGraph
A fan-out pattern in LangGraph looks like this: a router node receives the initial query and dispatches to multiple independent tool nodes simultaneously. Each tool node executes independently, and a reducer node aggregates the results before passing to the LLM for synthesis.
# LangGraph parallel fan-out pattern
from langgraph.graph import StateGraph
builder = StateGraph(ResearchState)
builder.add_node("router", route_query)
builder.add_node("fetch_stock", get_stock_price)
builder.add_node("fetch_wiki", get_wikipedia_summary)
builder.add_node("fetch_crm", query_crm)
builder.add_node("fetch_news", get_news_headlines)
builder.add_node("synthesize", llm_synthesize)
# Fan-out: router dispatches to all four tools simultaneously
builder.add_edge("router", "fetch_stock")
builder.add_edge("router", "fetch_wiki")
builder.add_edge("router", "fetch_crm")
builder.add_edge("router", "fetch_news")
# Fan-in: all tools converge at synthesize
for node in ["fetch_stock", "fetch_wiki", "fetch_crm", "fetch_news"]:
builder.add_edge(node, "synthesize")
This is clean. The graph structure makes parallelism explicit and auditable — you can read the edge definitions and immediately understand the execution order.
LangGraph benchmark results
| Metric | Sequential (forced) | Parallel (native) | Overhead |
|---|---|---|---|
| P50 latency | 4,820ms | 1,340ms | 180ms |
| P90 latency | 5,610ms | 1,890ms | 210ms |
| P99 latency | 6,240ms | 2,340ms | 290ms |
| Framework overhead | 95ms | 185ms | — |
Parallel execution reduced P50 latency by 72%. Framework overhead is low — under 200ms in most runs. The overhead is slightly higher in parallel mode due to asyncio task management, but this is negligible against the latency savings.
Where LangGraph adds friction
Explicit graph construction is a strength for auditability, but it adds development overhead. For simple agents with dynamic tool selection (where the LLM decides which tools to call at runtime), you need a more dynamic graph pattern or a ReAct-style node that handles tool dispatch internally. This creates a tradeoff: the cleaner parallel graphs require knowing your tool dependencies upfront.
For agents where tool calls depend on previous results — check the cache first, only fetch the API if the cache misses — sequential edges are the right model. LangGraph handles these conditional patterns cleanly via conditional edges, but it means more graph complexity.
CrewAI: sequential by default, parallel by configuration
CrewAI takes a different mental model: agents with roles, goals, and tool sets working on tasks. It is higher-level than LangGraph and faster to get running. The tradeoff is that tool execution is sequential by default, and parallel execution requires explicit configuration that many tutorials skip.
The sequential-by-default problem
When a CrewAI agent receives a task requiring multiple tools, it calls each tool in sequence, waiting for one to complete before starting the next. For the research task described above, this produced the 14.2 second P50 result.
This is not a bug — it reflects the agent reasoning model, where each tool result potentially informs the next tool call. But for tasks where tools are independent (fetch stock price and fetch Wikipedia summary have zero dependency on each other), sequential execution is pure waste.
Enabling parallel tool execution in CrewAI
CrewAI 0.80.x introduced allow_parallel_tool_calls as an agent-level parameter. Combined with async task execution, you can approximate the fan-out pattern:
from crewai import Agent, Task, Crew
researcher = Agent(
role="Research Analyst",
goal="Gather comprehensive company intelligence",
tools=[stock_tool, wiki_tool, crm_tool, news_tool],
allow_delegation=False,
# Enable parallel tool dispatch at the agent level
allow_parallel_tool_calls=True
)
However, allow_parallel_tool_calls does not guarantee parallel execution — it signals to the LLM that parallel calls are permitted. The actual parallelism depends on whether the model returns multiple tool_use blocks in a single response turn. With Claude models, this works reliably because the model will batch independent tool calls into a single response when the system prompt indicates parallelism is supported. With other models, results vary.
CrewAI benchmark results
| Metric | Default (sequential) | Parallel config | Overhead |
|---|---|---|---|
| P50 latency | 14,200ms | 4,100ms | 380ms |
| P90 latency | 16,800ms | 5,200ms | 490ms |
| P99 latency | 19,400ms | 6,900ms | 610ms |
| Framework overhead | 220ms | 380ms | — |
Parallel configuration reduced P50 latency by 71%, consistent with LangGraph. But notice the absolute numbers: even with parallel configuration, CrewAI’s P50 is 4,100ms versus LangGraph’s 1,340ms. The gap is framework overhead — CrewAI’s agent abstraction layer adds approximately 2.5-3x more overhead per tool dispatch cycle compared to LangGraph’s direct graph execution.
Where CrewAI adds friction
CrewAI is excellent for multi-agent workflows where agents hand off tasks to each other. The overhead is partly justified by the richer agent lifecycle management. But for single-agent scenarios requiring maximum tool execution speed, that overhead is a liability.
The documentation for allow_parallel_tool_calls is also sparse. Most teams discover it through GitHub issues rather than the official docs, which means many production CrewAI deployments are running sequential tool execution without knowing a parallel alternative exists.
For a full framework comparison including memory, state management, and multi-agent patterns, see the LangGraph vs CrewAI deep dive on agent-harness.ai.
Anthropic Agent SDK: native parallel tool_use blocks
The Anthropic Agent SDK (and directly, the Claude API) handles function calling through tool_use content blocks in the model’s response. Claude can — and frequently will — return multiple tool_use blocks in a single response turn when the requested tools are independent. This is native parallel dispatch at the model level.
How Claude handles parallel tool calls
When you send Claude a request that requires multiple independent tool calls, it returns a response with multiple tool_use blocks in a single API response:
{
"content": [
{
"type": "text",
"text": "I'll gather all the information simultaneously."
},
{
"type": "tool_use",
"id": "tool_1",
"name": "get_stock_price",
"input": {"ticker": "ACME"}
},
{
"type": "tool_use",
"id": "tool_2",
"name": "get_wikipedia_summary",
"input": {"company": "ACME Corp"}
},
{
"type": "tool_use",
"id": "tool_3",
"name": "get_news_headlines",
"input": {"query": "ACME Corp", "days": 2}
}
]
}
Your application receives all three tool requests simultaneously and executes them in parallel. The key insight: the model itself decides to batch independent calls. You do not need to explicitly configure a fan-out graph or enable parallel flags. Claude’s training optimizes for efficient tool use, and that includes recognizing when independent calls can be batched.
Anthropic Agent SDK benchmark results
| Metric | Single-turn multi-call | Sequential (forced) | Overhead |
|---|---|---|---|
| P50 latency | 1,180ms | 4,650ms | 65ms |
| P90 latency | 1,540ms | 5,420ms | 90ms |
| P99 latency | 1,980ms | 6,180ms | 120ms |
| Framework overhead | 65ms | 65ms | — |
Framework overhead is the lowest of the three at 65ms median. The SDK is thin — it handles message formatting, tool result injection, and conversation state, but adds minimal execution overhead. P50 latency for the parallel case at 1,180ms is the fastest of the three frameworks, narrowly beating LangGraph’s 1,340ms.
The batching reliability question
The model-driven batching approach introduces one variable: Claude does not always batch calls on every turn. Under certain conditions — complex reasoning steps, ambiguous tool independence, or tasks where the model judges that tool A’s output should inform tool B’s input — Claude will execute calls sequentially across multiple turns.
In practice, this happened on 3 of 100 test runs for the research task. When it did, latency jumped to 4,200-5,100ms. The P99 at 1,980ms reflects runs where batching occurred as expected; the rare sequential fallback is captured in the tail of the distribution.
You can influence this behavior through system prompt engineering: explicitly stating “execute independent tool calls in parallel” and structuring your tool definitions with clear independence signals reduces sequential fallback frequency.
Marcus Kim’s production story
Marcus Kim, a backend engineer at a fintech startup, built a document analysis agent using the Anthropic API directly. His initial implementation processed tool calls sequentially — extract entities, classify sentiment, check compliance flags, generate summary. Each document took 8-12 seconds.
After refactoring to handle multiple tool_use blocks in parallel with Python’s asyncio.gather(), the same documents processed in 2.1-3.4 seconds. His system prompt change was three sentences: “When you identify tool calls that do not depend on each other’s output, return them together in a single response. Do not wait for one tool’s result before requesting the next if they are independent. Parallel execution is preferred for efficiency.”
That prompt change, combined with parallel tool result processing in his handler, cut average processing time by 73%.
Batching strategies that actually work
Parallel dispatch is the high-leverage optimization, but batching strategies at the application layer further reduce overhead. Three approaches showed consistent results across all three frameworks.
Strategy 1: Static dependency analysis
Before agent execution, analyze your tool definitions to identify independence clusters — groups of tools that can always run in parallel regardless of agent state. Hardcode these clusters into your execution graph (LangGraph) or document them for system prompt injection (Anthropic SDK).
For the research task, the dependency graph is flat: all five tools are always independent. Knowing this upfront lets you configure parallel dispatch without relying on the model to infer it at runtime.
Latency impact: 15-25% reduction over model-inferred parallelism, primarily from eliminating the occasional sequential fallback.
Strategy 2: Progressive result streaming
For agents that run many tool calls across multiple turns, stream partial results to the user as they complete rather than waiting for the full agent execution to finish. Users perceive lower latency even when total execution time is unchanged.
LangGraph supports this natively via streaming graph state. The Anthropic SDK supports streaming via Server-Sent Events. CrewAI requires custom middleware.
Latency impact: No reduction in total execution time, but perceived latency drops 40-60% in user testing.
Strategy 3: Tool result caching with TTL
For agents that call the same tools repeatedly across a session (or across users in multi-tenant deployments), caching tool results with a time-to-live reduces redundant external calls.
A stock price tool cached at 30-second TTL reduces API calls by 85% in a typical trading intelligence agent where multiple users query the same tickers. CRM queries cached at 5-minute TTL reduce database load proportionally.
Latency impact: Cached calls return in under 5ms versus 180-510ms for live calls. For agents with 30-50% cache hit rates, total execution time drops 20-35%.
Latency optimization across frameworks: what actually moves the needle
After running 60 benchmark variants across the three frameworks, these patterns drove the largest latency reductions in order of impact:
-
Enable parallel dispatch — 60-78% reduction in total tool execution time for fan-out tasks. The highest-leverage change available.
-
Eliminate unnecessary tool calls — before optimizing parallel execution, audit whether all tool calls are actually necessary for the task. Removing one of five tools reduces execution time more reliably than optimizing the five.
-
Colocate agent and tool infrastructure — for tools hitting internal services (databases, caches, internal APIs), network round-trip time is a major contributor to per-call latency. Running the agent in the same AWS region as your services cut tool call latency by 35-45% in our tests.
-
Use streaming for user-facing responses — if users are waiting for the full agent response, streaming perceived completion feels 40% faster even with identical total times.
-
Cache at the tool layer — TTL-based caching reduces redundant external calls and their associated latency tails.
Limitations worth knowing
Parallel dispatch is not universally beneficial. For tasks where tool calls are inherently sequential (read the user’s account ID, then fetch the account details with that ID), forcing parallel execution is impossible and attempting it creates complexity without benefit.
CrewAI’s overhead is higher than LangGraph and the Anthropic SDK for single-agent scenarios. But for multi-agent pipelines where agents delegate tasks to specialist sub-agents, CrewAI’s abstractions handle coordination logic that you would need to build manually in LangGraph or the Anthropic SDK.
The Anthropic SDK’s model-driven batching is the simplest to implement but has the highest variance. For latency-critical production systems, explicit parallel dispatch (LangGraph or manual asyncio in the Anthropic SDK) is more reliable than relying on the model to batch correctly on every turn.
Framework selection guide: matching execution model to task requirements
| Scenario | Recommended Framework | Reason |
|---|---|---|
| Known tool dependency graph | LangGraph | Explicit parallel edges, predictable execution |
| Rapid prototyping, flexibility | Anthropic Agent SDK | Minimal overhead, model-native batching |
| Multi-agent coordination | CrewAI | Agent delegation and role management |
| Highest throughput single-agent | LangGraph | Lowest absolute latency for parallel tasks |
| Dynamic tool selection at runtime | Anthropic Agent SDK | Model decides batching without graph configuration |
| Existing LangChain investment | LangGraph | Direct compatibility, familiar primitives |
Conclusion
Function calling efficiency in AI agents is a production concern that most developers encounter too late — after they have deployed agents that feel slow and frustrated users who expected better.
The benchmarks here tell a consistent story: parallel tool dispatch reduces total execution latency by 70-78% across all three frameworks. The mechanism differs — explicit graph edges in LangGraph, model-native batching in the Anthropic SDK, and configuration flags in CrewAI — but the outcome is the same. Sequential tool execution is the default state in many frameworks and the first thing to address.
LangGraph provides the most predictable parallel execution and lowest framework overhead. The Anthropic Agent SDK has the thinnest overhead layer and handles common cases automatically through model-native batching. CrewAI is slower per tool dispatch but the right choice when multi-agent coordination is the actual requirement.
Three things to do with this:
- Audit your existing agents for sequential tool dispatch where tools are independent.
- Run the five-tool benchmark yourself against your production framework and measure actual latency.
- Implement TTL-based tool result caching at the application layer — it is framework-agnostic and compounds with parallel dispatch.
If you are evaluating frameworks for a new agent build, the agent-harness.ai framework evaluation toolkit includes runnable benchmark scripts for all three frameworks covered here, with configurable tool counts and latency profiles.
Alex Rivera is a Framework Analyst at agent-harness.ai with a focus on agent performance benchmarking and production evaluation. He has tested over 40 agent frameworks across latency, reliability, and cost dimensions.