Skip to content

Conversation

@airportyh
Copy link
Contributor

@airportyh airportyh commented Mar 13, 2025

Why

  1. Some py-spy tracing found a possible bottleneck with creating TypeAdapters.
  2. Pydantic performance tips that says that caching TypeAdapters is good

Also https://github.com/replit/ai-infra/pull/4672

What changed

Changed the river-python client to generate code that caches the TypeAdapters.

Testing

  • tests pass
  • regenerating chat and pid2 clients and their tests still pass

@airportyh airportyh changed the title Th cache type adapters Cache type adapters Mar 13, 2025
@airportyh airportyh marked this pull request as ready for review March 13, 2025 13:03
@airportyh airportyh requested a review from a team as a code owner March 13, 2025 13:03
@airportyh airportyh requested review from blast-hardcheese and removed request for a team March 13, 2025 13:03
airportyh and others added 3 commits March 14, 2025 17:12
Copy link
Contributor

@blast-hardcheese blast-hardcheese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good stuff, thanks for pairing!

@airportyh airportyh merged commit 26ba67e into main Mar 14, 2025
3 checks passed
@airportyh airportyh deleted the th-cache-type-adapters branch March 14, 2025 21:20
@blast-hardcheese blast-hardcheese added enhancement New feature or request minor Bump minor version labels Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor Bump minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants