Files
langchain/libs/core/langchain_core
John Kennedy e2da14595b perf(core): optimize callback manager hot paths
- get_child(): pass state directly to constructor instead of calling
  set_handlers/add_tags/add_metadata sequentially (-22%)
- add_tags(): use set-based dedup instead of O(n) list scans per tag,
  early return when tags list is empty (-70% on duplicate tags)
- handle_event/ahandle_event: early return when handlers list is empty
- _configure(): skip throwaway CallbackManager construction on the
  common path where inheritable_callbacks is provided

These are the top bottlenecks identified by profiling langgraph's
react_agent benchmark, where langchain_core callbacks account for ~35%
of runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 21:37:52 -08:00
..
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-01-23 23:07:48 -05:00
2026-02-25 09:31:15 -05:00