Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace OnceCell with static OnceLock for regex compilation #250

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

itsfolf
Copy link
Contributor

@itsfolf itsfolf commented Nov 15, 2024

The several Regex expressions used for validating types such as DateTime and DID are compiled individually during each deserialization. When profiling an application consuming thousands of events a second (firehose), these account for nearly 50% of CPU time.

@sugyan
Copy link
Owner

sugyan commented Nov 15, 2024

Thank you for the pull-request!
It certainly seems to impact performance if it is run on many threads significantly.

@sugyan sugyan merged commit 4896bb7 into sugyan:main Nov 15, 2024
12 checks passed
@github-actions github-actions bot mentioned this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants