-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
A fast path is added to WildcardPattern.IsMatch for patterns like test*. However, this shows no noticeable improvements to dir -Recurse C:\Windows\System32\p*.
Quoted from @iSazonov's comment #10054 (comment)
When we send a path like
C:\Windows\System32\p*to engine our globbing code does all work - parse and expandp*to a collection with leaves. Then the already filtered leaves (in the example, all started with "p") is passed to a code which again filters the leaves by WindcardPattern.IsMatch(). So (1) we don't filter large, all full path list, only small collection of leaves - that's why we get so little acceleration, (2) we do duplicated work that we would address, I believe it is common problem in globbing code - there is many places where it happens.
So it's possible our globing code is doing duplicate filtering, and it would be an optimization opportunity.