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

Get rid of matchesGlobPatterns #272

Open
Martoon-00 opened this issue Jan 27, 2023 · 0 comments
Open

Get rid of matchesGlobPatterns #272

Martoon-00 opened this issue Jan 27, 2023 · 0 comments

Comments

@Martoon-00
Copy link
Member

Clarification and motivation

Thanks to the recent profiling performed by @aeqz, I noted the that matchesGlobPatterns takes so much time. And hilariously, looks like we somehow fell into that very problem - we compile glob patterns every time we want to perform a match instead of compiling once in advance.

I would try to concentrate on removing matchesGlobPatterns (it joins glob compilation with matching which feels like an anti-pattern), compiling globs early, and carrying around the compiled globs.

Note, that matchesGlobPattern call inside toScan is shown to take 32.37% of the time at that flamegraph. But this call constitutes that minority of our logic that is not parallelized, so the gain measured in time will be larger, would not be surprised if it eventually takes half of the time.

Acceptance criteria

  • matchesGlobPatterns is removed.
  • Every glob pattern we receive is compiled only once, or maximum twice (if necessary to parse w/ and w/o root known).
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

No branches or pull requests

1 participant