Skip to content

fix: initialize available_tokens to max_bucket_size#36057

Closed
LincolnBurrows2017 wants to merge 1 commit intolangchain-ai:masterfrom
LincolnBurrows2017:fix-rate-limiter-bursting
Closed

fix: initialize available_tokens to max_bucket_size#36057
LincolnBurrows2017 wants to merge 1 commit intolangchain-ai:masterfrom
LincolnBurrows2017:fix-rate-limiter-bursting

Conversation

@LincolnBurrows2017
Copy link
Contributor

Fixed rate limiter to allow bursting on first request

@github-actions github-actions bot added core `langchain-core` package issues & PRs fix For PRs that implement a fix size: XS < 50 LOC labels Mar 18, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 18, 2026

Merging this PR will improve performance by 30.84%

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

⚡ 13 improved benchmarks
⏩ 23 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_import_time[CallbackManager] 336.1 ms 262.2 ms +28.2%
WallTime test_import_time[ChatPromptTemplate] 677.3 ms 529.5 ms +27.91%
WallTime test_import_time[LangChainTracer] 480.7 ms 373.7 ms +28.61%
WallTime test_import_time[PydanticOutputParser] 565.5 ms 446.9 ms +26.52%
WallTime test_async_callbacks_in_sync 25.2 ms 20 ms +26.04%
WallTime test_import_time[HumanMessage] 277.3 ms 214.8 ms +29.07%
WallTime test_import_time[Runnable] 522.8 ms 406.3 ms +28.69%
WallTime test_import_time[Document] 200.2 ms 154 ms +29.95%
WallTime test_import_time[InMemoryRateLimiter] 181.2 ms 141.9 ms +27.68%
WallTime test_import_time[tool] 582.2 ms 458.2 ms +27.05%
WallTime test_import_time[BaseChatModel] 573.4 ms 438.2 ms +30.84%
WallTime test_import_time[InMemoryVectorStore] 643.7 ms 503.4 ms +27.87%
WallTime test_import_time[RunnableLambda] 522.3 ms 404.4 ms +29.15%

Comparing LincolnBurrows2017:fix-rate-limiter-bursting (3821069) with master (07fa576)2

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.

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

@github-actions
Copy link

This PR has been automatically closed because it does not link to an approved issue.

All external contributions must reference an approved issue or discussion. Please:

  1. Find or open an issue describing the change
  2. Wait for a maintainer to approve and assign you
  3. Add Fixes #<issue_number>, Closes #<issue_number>, or Resolves #<issue_number> to your PR description and the PR will be reopened automatically

@github-actions github-actions bot closed this Mar 18, 2026
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 external fix For PRs that implement a fix missing-issue-link size: XS < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant