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

Use custom match in FileUtilities.GetFullPath #4283

Closed
rainersigwald opened this issue Apr 3, 2019 · 2 comments
Closed

Use custom match in FileUtilities.GetFullPath #4283

rainersigwald opened this issue Apr 3, 2019 · 2 comments

Comments

@rainersigwald
Copy link
Member

@davkean, @benvillalobos and I were doing some exploratory PerfView analysis and noticed this.

#3969 tried to reduce the allocation of Regex.Match objects that aren't necessary because all we care about is IsMatch. That simplified the code greatly. But unfortunately, it still allocates a Match object under the covers.

We should replace usages of FileUtilitiesRegex.DrivePattern, FileUtilitiesRegex.UncPattern, StartWithDrivePattern, and StartsWithUncPattern with functions that do the match explicitly without allocation. The patterns are pretty straightforward, so the matcher methods should still be pretty readable.

@rainersigwald
Copy link
Member Author

This will help with part of #2645.

@benvillalobos
Copy link
Member

This was fixed in #4304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants