Skip to content

fix(core): apply cap when scaling approximate token counts#35005

Merged
ccurme (ccurme) merged 1 commit intomasterfrom
cc/token_scaling
Feb 4, 2026
Merged

fix(core): apply cap when scaling approximate token counts#35005
ccurme (ccurme) merged 1 commit intomasterfrom
cc/token_scaling

Conversation

@ccurme
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions github-actions Bot added core `langchain-core` package issues & PRs fix For PRs that implement a fix internal labels Feb 4, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Feb 4, 2026

Merging this PR will degrade performance by 23.71%

⚠️ 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.

❌ 9 regressed benchmarks
✅ 4 untouched benchmarks
⏩ 21 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_import_time[CallbackManager] 424.2 ms 475.8 ms -10.85%
WallTime test_async_callbacks_in_sync 18.1 ms 23.7 ms -23.71%
WallTime test_import_time[Runnable] 447.9 ms 519.8 ms -13.83%
WallTime test_import_time[tool] 465.1 ms 539.2 ms -13.74%
WallTime test_import_time[Document] 169 ms 189.8 ms -10.94%
WallTime test_import_time[HumanMessage] 237.8 ms 268.1 ms -11.32%
WallTime test_import_time[LangChainTracer] 404.3 ms 453.1 ms -10.77%
WallTime test_import_time[ChatPromptTemplate] 548.6 ms 641.4 ms -14.48%
WallTime test_import_time[BaseChatModel] 488.8 ms 555.2 ms -11.96%

Comparing cc/token_scaling (a4d3120) with master (09654f4)2

Open in CodSpeed

Footnotes

  1. 21 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.

  2. No successful run was found on master (643355f) during the generation of this report, so 09654f4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@ccurme ccurme (ccurme) merged commit 5981ee1 into master Feb 4, 2026
92 of 93 checks passed
@ccurme ccurme (ccurme) deleted the cc/token_scaling branch February 4, 2026 02:20
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 fix For PRs that implement a fix internal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant