-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(changed-files): limit git and hg commands to specified roots (#6732
) ## Summary Given a monorepo setup under git version control, we saw `jest --watch` commands take significantly longer in a Docker container host mount (`rw:cached`) than when on the host directly. Tracked the issue down to the fact that `git` and `hg` command used to determine `lastCommit` changes were traversing the entire repository, and not just paths specified in the Jest config `roots` values. Given the mounted container latency, things like basic `lstat` gathering be intensive in a large repository. The `roots` we had specified are rather shallow themselves and only contain things we want to test with Jest. When limiting the scope of the `git` command to just the `roots` paths, we saw change determination drop from 2.5m to 3s in our container. This implementation seem to align more closely with the [`roots` documentation](https://jestjs.io/docs/en/configuration#roots-array-string) which indicates: > A list of paths to directories that Jest should use to search for files in. It did seem a little unexpected that Jest would be traversing our entire repo.
- Loading branch information
1 parent
bf9cbc2
commit 79089db
Showing
6 changed files
with
76 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters