Skip to content

chore(core): Normalization of total_cost for prompt key in llm_cache#35312

Open
Mohammad Mohtashim (keenborder786) wants to merge 8 commits intolangchain-ai:masterfrom
keenborder786:mmk/store_cached_generation
Open

chore(core): Normalization of total_cost for prompt key in llm_cache#35312
Mohammad Mohtashim (keenborder786) wants to merge 8 commits intolangchain-ai:masterfrom
keenborder786:mmk/store_cached_generation

Conversation

@keenborder786
Copy link
Contributor

@github-actions github-actions bot added external core `langchain-core` package issues & PRs infra PRs made that include chores, devops, repo meta changes and removed external labels Feb 18, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 20, 2026

Merging this PR will improve performance by 35.8%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 12 improved benchmarks
✅ 1 untouched benchmark
⏩ 23 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_import_time[HumanMessage] 274.2 ms 245.6 ms +11.66%
WallTime test_import_time[PydanticOutputParser] 573.6 ms 485.9 ms +18.03%
WallTime test_import_time[RunnableLambda] 519.5 ms 450.1 ms +15.42%
WallTime test_import_time[InMemoryVectorStore] 625.8 ms 554.2 ms +12.91%
WallTime test_import_time[CallbackManager] 328.2 ms 290.4 ms +13.04%
WallTime test_import_time[ChatPromptTemplate] 660.6 ms 567 ms +16.51%
WallTime test_import_time[BaseChatModel] 560.9 ms 487 ms +15.18%
WallTime test_import_time[Runnable] 513.6 ms 447.7 ms +14.72%
WallTime test_async_callbacks_in_sync 25.8 ms 19 ms +35.8%
WallTime test_import_time[Document] 197.5 ms 170.7 ms +15.66%
WallTime test_import_time[LangChainTracer] 475 ms 420.6 ms +12.93%
WallTime test_import_time[tool] 561.9 ms 486.4 ms +15.51%

Comparing keenborder786:mmk/store_cached_generation (d83eddd) with master (cdf140e)

Open in CodSpeed

Footnotes

  1. 23 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core `langchain-core` package issues & PRs infra PRs made that include chores, devops, repo meta changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache hit total_cost injection breaks downstream cache keys for multi-turn conversations

1 participant