langchain-ai
langchain
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
perf(core): optimize merge_lists from O(n) to O(n) with index lookup map Previously, merge_lists performed a linear scan through the entire merged list for each element in the 'other' list to find matching indices, resulting in O(n*m) complexity where n is len(merged) and m is len(other). This optimization builds a dict-based index lookup map once per merge operation, reducing index lookups from O(n) to O(1). The map is also updated when new elements are appended. This is a critical hot path during streaming - merge_lists is called on every chunk to merge tool call content, content blocks, and other indexed data structures.
Rudra-Tiwari-codes:perf/merge-lists-index-lookup-optimization
16 hours ago
perf(core): move origin type map to module level in function_calling.py Move _ORIGIN_MAP dict from inside _py_38_safe_origin() to module level constant. This avoids dict allocation on every function call, reducing garbage collection pressure during frequent tool conversions. The function is called during typed dict to pydantic model conversion which happens during tool binding and invocation.
Rudra-Tiwari-codes:perf/module-level-origin-map
16 hours ago
perf(core): precompile hex color regex pattern at module level Move _HEX_COLOR_PATTERN regex compilation from inside _render_mermaid_using_api() to module level. This avoids recompiling the regex on every function call, improving performance when rendering multiple Mermaid graphs. Also combined nested if statements per SIM102 lint rule.
Rudra-Tiwari-codes:perf/precompile-hex-color-regex
16 hours ago
fix(core): correct return type hints for parse_json_markdown and _parse_json The functions parse_json_markdown and _parse_json in utils/json.py incorrectly had return type hints of 'dict', but JSON parsing can return any valid JSON type (dict, list, str, int, float, bool, or None). This fixes the type hints to correctly return 'Any'. This contribution was made with AI assistance.
Rudra-Tiwari-codes:fix/json-parse-return-type-hints
16 hours ago
fix(anthropic): handle pre-completed content in message_start streaming events When using Anthropic code execution with external tools, the API may return message_start events with pre-completed content blocks and no subsequent content_block events. This fix processes any content in event.message.content when handling message_start, preventing empty AIMessage responses. Fixes #34406 This contribution was made with AI assistance.
Rudra-Tiwari-codes:fix/anthropic-streaming-message-start-content
17 hours ago
fix(core): correct return type hints for parse_json_markdown and _parse_json The functions parse_json_markdown and _parse_json in utils/json.py incorrectly had return type hints of 'dict', but JSON parsing can return any valid JSON type (dict, list, str, int, float, bool, or None). This fixes the type hints to correctly return 'Any'. This contribution was made with AI assistance.
Rudra-Tiwari-codes:fix/json-parse-return-type-hints
17 hours ago
fix: sort imports in test_base.py Signed-off-by: majiayu000 <1835304752@qq.com>
majiayu000:fix/rate-limiter-embeddings
23 hours ago
style(core): add ruff rules TC
cbornet:ruff-core-tc
1 day ago
Active Branches
perf(core): optimize merge_lists from O(n^2) to O(n) with index lookup map
last run
16 hours ago
#34482
CodSpeed Performance Gauge
-1%
perf(core): move origin type map to module level in function_calling.py
last run
16 hours ago
#34481
CodSpeed Performance Gauge
+6%
perf(core): precompile hex color regex pattern at module level
last run
16 hours ago
#34480
CodSpeed Performance Gauge
+7%
© 2025 CodSpeed Technology
Home
Terms
Privacy
Docs