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

Don't compile SDK pattern regexes on .NET Framework #9173

Merged
merged 1 commit into from Aug 28, 2023

Conversation

ladipro
Copy link
Member

@ladipro ladipro commented Aug 25, 2023

Contributes to AB#1811625

Context

Compiled regular expressions tend to run slower than interpreted ones on .NET Framework. Additionally, the cost of compiling is significant, especially on 64-bit.

Here's a benchmark running IsMatch("Microsoft.NET.Sdk") against the only SDK regex we ship inbox: ^(?i)vcpkg:.*. Note that it does not include the compilation, which is an additional one-time cost.

image

Changes Made

Interpret ResolvableSdkRegex on .NET Framework. We made an analogous change to globbing some time ago in #6632.

Testing

Existing unit tests, targeted micro benchmark.

Notes

In the trace attached to the AzDO bug, this change eliminates 1/3 of the SDK resolution cost.

@ladipro ladipro merged commit d8e974b into dotnet:main Aug 28, 2023
8 checks passed
@ladipro ladipro deleted the interpret-regex branch August 28, 2023 06:28
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.

None yet

3 participants