Performance: Sequential chains
MEDIUM IMPACT
Sequential chains affect the latency and throughput of processing multiple steps in a language model workflow, impacting user wait time and responsiveness.
from langchain.schema.runnable import RunnableParallel chain = RunnableParallel({"a": chainA, "b": chainB, "c": chainC}) result = chain.invoke(input_data)
chain1 = SequentialChain(chains=[chainA, chainB, chainC]) result = chain1.run(input_data)
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Sequential chain (one after another) | Minimal DOM changes | 0 reflows | Low paint cost | [!] OK but blocks input responsiveness |
| Concurrent chain (parallel execution) | Minimal DOM changes | 0 reflows | Low paint cost | [OK] Improves input responsiveness |