Skip to content

Change ID generation to use threading.local instead of ContextVar - #2063

Open
plypaul wants to merge 2 commits into
mainfrom
p/perf__02
Open

Change ID generation to use threading.local instead of ContextVar#2063
plypaul wants to merge 2 commits into
mainfrom
p/perf__02

Conversation

@plypaul

@plypaul plypaul commented May 29, 2026

Copy link
Copy Markdown
Contributor

This PR updates ID generation to use threading.local instead of ContextVar as we didn't end up using async calls. The implementation using ContextVar had a significant performance impact in some cases (~10%).

@cla-bot cla-bot Bot added the cla:yes label May 29, 2026
@plypaul
plypaul marked this pull request as ready for review May 29, 2026 19:38
@plypaul
plypaul requested a review from a team as a code owner May 29, 2026 19:38
Base automatically changed from p/perf__01 to main June 4, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants