# util: Use GlobSet in PathMatcher \(\#13197\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/5dc26c261d5726c139aedda0d459b4592c8ceea9)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 5dc26c261d5726c139aedda0d459b4592c8ceea9

Requested commit: 5dc26c261d5726c139aedda0d459b4592c8ceea9

Commit: 5dc26c261d5726c139aedda0d459b4592c8ceea9

Tree: 1ff17cac75935b8338d3ef75316c5965a5fa4643

Author: Piotr Osiewicz

Committer: GitHub

## Message

```
util: Use GlobSet in PathMatcher (#13197)

Previously we were using a single globset::Glob in PathMatcher; higher
up the stack, we were then resorting to using a list of PathMatchers.
globset crate exposes a GlobSet type that's better suited for this use
case. In my benchmarks, using a single PathMatcher with GlobSet instead
of a Vec of PathMatchers with Globs is about 3 times faster with the
default 'file_scan_exclusions' values. This slightly improves our
project load time for projects with large # of files, as showcased in
the following videos of loading a project with 100k source files. This
project is *not* a git repository, so it should measure raw overhead on
our side.

Current nightly: 51404d4ea08cb5ba1cd678b9963037bde31aa7b2


https://github.com/zed-industries/zed/assets/24362066/e0aa9f8c-aae6-4348-8d42-d20bd41fcd76

versus this PR:


https://github.com/zed-industries/zed/assets/24362066/408dcab1-cee2-4c9e-a541-a31d14772dd7



Release Notes:

- Improved performance in large worktrees
```

## Parents

- [64d815a1766db69aabedc74069cef9b6c134f42f](https://git.cafe/gitcafe/zed/commit/64d815a1766db69aabedc74069cef9b6c134f42f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/5dc26c261d5726c139aedda0d459b4592c8ceea9?format=markdown)
