Commit 95db1bc
authored
Add a fast path for NameSets without wildcards (#241)
When the set of ignored names doesn't use shell-style wildcards, we can
use the faster `frozenset.__contains__` base implementation rather than
the more expensive iteration-based fnmatch'ing approach. This is true
for the default ignore list, and I expect its the more common case by
far even for those who add their own ignored names.
In a simple local benchmark, this results in a 2x speed improvement for
that common (default) path, which I think justifies the small additional
complexity.1 parent bc1a7e4 commit 95db1bc
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
0 commit comments