mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-20 06:35:46 +02:00
Add --profile flag to bench/__main__.py that bypasses pyperf and runs each benchmark under cProfile, printing per-benchmark hotspot summaries and writing .prof files for later analysis. Add benchmark-profile and benchmark-profile-spy Makefile targets. Fix O(n^2) performance regression in _get_model_input_state where f-strings eagerly evaluated repr(state) on every call, triggering pydantic __repr__ across all accumulated messages. Move error message construction into the error path so repr is only called when needed. This yields a 3-5x speedup on react_agent_100x benchmarks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>