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

Improved performance of frequently used regex #365

Merged
merged 1 commit into from
Jul 12, 2023
Merged

Improved performance of frequently used regex #365

merged 1 commit into from
Jul 12, 2023

Conversation

jsoverson
Copy link
Contributor

The OCI reference regex has some hotspots in it that aren't important to common use cases. This changes custom character classes to internal character classes (i.e. [a-zA-Z0-9] to [:alnum:]) and removes match bounds (i.e. {0,127}).

The result is a >85% perf improvement and improved memory usage. It's not a major bottleneck but the regex is used frequently when fetching/checking asset references so it helps.

@jsoverson jsoverson merged commit 3ae02ba into main Jul 12, 2023
@jsoverson jsoverson deleted the oci-regex branch July 12, 2023 18:32
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.

1 participant