You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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.
The text was updated successfully, but these errors were encountered:
@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 isIsMatch
. That simplified the code greatly. But unfortunately, it still allocates aMatch
object under the covers.We should replace usages of
FileUtilitiesRegex.DrivePattern
,FileUtilitiesRegex.UncPattern
,StartWithDrivePattern
, andStartsWithUncPattern
with functions that do the match explicitly without allocation. The patterns are pretty straightforward, so the matcher methods should still be pretty readable.The text was updated successfully, but these errors were encountered: