Maybe add a compile function #183
Labels
P: maybe
Pending approval of low priority request.
skip-triage
Tells bot to not tag a new issue with 'triage'.
T: feature
Feature.
Wcmatch caches patterns, but for instance, it doesn't cache pattern expansion. So if a pattern uses something like
{1..100}
, you'd get 100 patterns cached, so the expansion would still happen every time, but the parsing of each pattern would not. We currently do this because we don't want someone filling memory with massive cache entries. So, there is always a little overhead when calling afnmatch.match
or aglob.globmatch
calls, more so if you are using braces or splitting with|
It may be nice though, to pre-compile a match that can be used over and over again. Once compiled, you could call it with very little overhead. Something like:
The text was updated successfully, but these errors were encountered: