Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: skip expanding exclude globs #21817

Merged
merged 20 commits into from
Jan 8, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Jan 5, 2024

We were calling expand_glob on our excludes, which is very expensive and unnecessary because we can pattern match while traversing instead.

  1. Doesn't expand "exclude" globs. Instead pattern matches while walking the directory.
  2. Splits up the "include" into base paths and applicable file patterns. This causes less pattern matching to occur because we're only pattern matching on patterns that might match and not ones in completely unrelated directories.
> cat deno.json
{
  "exclude": [
    "**/*"
  ]
}
> $pwd
V:\deno
> Measure-Command { deno lint example.ts test.ts }
error: No target files found.

TotalMilliseconds : 18619.8395
> Measure-Command { ./target/debug/deno lint example.ts test.ts }
error: No target files found.

TotalMilliseconds : 398.169

@dsherret dsherret marked this pull request as draft January 5, 2024 20:31
@dsherret dsherret marked this pull request as ready for review January 6, 2024 05:36
@dsherret dsherret enabled auto-merge (squash) January 8, 2024 16:58
@dsherret dsherret merged commit e212e1f into denoland:main Jan 8, 2024
14 checks passed
bartlomieju pushed a commit that referenced this pull request Jan 12, 2024
We were calling `expand_glob` on our excludes, which is very expensive
and unnecessary because we can pattern match while traversing instead.

1. Doesn't expand "exclude" globs. Instead pattern matches while walking
the directory.
2. Splits up the "include" into base paths and applicable file patterns.
This causes less pattern matching to occur because we're only pattern
matching on patterns that might match and not ones in completely
unrelated directories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants