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

feat(vcs): add new git repo scanning method to improve resolution speed #4642

Merged
merged 4 commits into from
Jul 6, 2023

Conversation

edvald
Copy link
Collaborator

@edvald edvald commented Jun 15, 2023

This adds a new experimental git repo scanning method, enabled by setting
scan.git.mode: repo in the project config or by setting
GARDEN_GIT_SCAN_MODE=repo.

It can still do with quite a bit of optimization but the general idea is to
do far fewer (albeit generally more expensive) calls to git.

For now I don't think it makes sense to make this the default since there are
pros and cons to either approach, but for large repositories with many
actions/modules this is likely to be more efficient.

I suggest we collect user feedback and do IRL tests before diving in and
optimizing further. One obvious optimization will be to index the repository
files more efficiently, instead of just filtering on a straight list of paths.
It would also make sense to delay hashing files that aren't in the index until
they are called upon.

This is the first step to resolve #3452

@edvald edvald marked this pull request as ready for review June 15, 2023 03:22
@vvagaytsev
Copy link
Collaborator

@edvald is this ready for review? There are a few test failures.

@edvald
Copy link
Collaborator Author

edvald commented Jun 15, 2023

I need to look at those, pushed just last night after working on this on my SF flight. I'd say it's ready for preliminary review maybe.

@edvald edvald force-pushed the git-repo-scan branch 2 times, most recently from 72e8734 to a8f5255 Compare June 16, 2023 15:00
Copy link
Collaborator

@thsig thsig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! This was a fun read : )

I don't have any further comments on the code as things stand, but I've yet to do manual testing on some larger repos to examine performance more closely. Will do so early this week.

core/src/vcs/git.ts Show resolved Hide resolved
core/src/vcs/git.ts Outdated Show resolved Hide resolved
core/src/vcs/vcs.ts Outdated Show resolved Hide resolved
edvald added 4 commits July 6, 2023 17:06
This adds a new experimental git repo scanning method, enabled by setting
`scan.git.mode: repo` in the project config or by setting
`GARDEN_GIT_SCAN_MODE=repo`.

It can still do with quite a bit of optimization but the general idea is to
do far fewer (albeit generally more expensive) calls to git.

For now I don't think it makes sense to make this the default since there are
pros and cons to either approach, but for large repositories with many
actions/modules this is likely to be more efficient.

I suggest we collect user feedback and do IRL tests before diving in and
optimizing further. One obvious optimization will be to index the repository
files more efficiently, instead of just filtering on a straight list of paths.
It would also make sense to delay hashing files that aren't in the index until
they are called upon.
@edvald
Copy link
Collaborator Author

edvald commented Jul 6, 2023

I've rebased the PR. @thsig can we get this merged please? It does include performance optimizations even for the default scanning method. We can always iterate on the newer experimental version.

@thsig
Copy link
Collaborator

thsig commented Jul 6, 2023

Yeah, sounds good. I've just approved it.

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.

Faster module resolution
3 participants