Root cause: sequential execution of "messages.create"
3 "anthropic.messages.create" spans ran one after another — each started only after the previous one finished. Total: 7.1s, slowest single call: 2.4s. Running them concurrently saves 4.7s — a 2.9× speedup.
7.1s
~2.4s
Fix: run calls in parallel
from concurrent.futures import ThreadPoolExecutor
# Before — sequential, each call blocks the next:
for item in items:
result = process(item)
# After — all calls run concurrently:
with ThreadPoolExecutor(max_workers=8) as pool:
results = list(pool.map(process, items))
# Cost unchanged. Output unchanged. Time = slowest single call.Waterfall
workflow.execute
anthropic.messages.create
Summarize the Q3 earnings report attached. Focus on revenue, margin, and guidance.
(answer to: Summarize the Q3 earnings report attache…)
anthropic.messages.create
Given the customer ticket below, draft a refund response that follows policy P-204.
Refund approved under policy P-204(b), $189.99 returned to card ending 4421 within 3 days…
anthropic.messages.create
Translate the user manual section to Japanese, preserving the table structure.
(answer to: Translate the user manual section to Jap…)
Faithfulness · anthropic.messages.create0.50
2 supported · 1 contradicted · 1 unsupported of 4 claims
- supported
Policy P-204(b) applies to this request.
- contradicted
The refund amount is $189.99.
- unsupported
The card on file ends in 4421.
- supported
Refunds settle within 3 business days.
Faithfulness · anthropic.messages.create0.50
1 supported · 0 contradicted · 1 unsupported of 2 claims
- unsupported
All chapters were translated.
- supported
Tables were preserved in the output.