-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
fix: only check for watchman existence once per process #14826
fix: only check for watchman existence once per process #14826
Conversation
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has nothing to do with the other fix, just sneaking it in as #14804 missed it
@@ -216,7 +218,6 @@ class HasteMap extends EventEmitter implements IHasteMap { | |||
private _cachePath = ''; | |||
private _changeInterval?: ReturnType<typeof setInterval>; | |||
private readonly _console: Console; | |||
private _isWatchmanInstalledPromise: Promise<boolean> | null = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this made the check happens once per project, while we now do it once per module scope (i.e. once per worker/thread/process)
@@ -50,6 +50,7 @@ | |||
### Performance | |||
|
|||
- `[*]` [**BREAKING**] Bundle all of Jest's modules into `index.js` ([#12348](https://github.com/jestjs/jest/pull/12348), [#14550](https://github.com/jestjs/jest/pull/14550) & [#14661](https://github.com/jestjs/jest/pull/14661)) | |||
- `[*]` [jest-haste-map] Only spawn one process to check for `watchman` installation ([#14826](https://github.com/jestjs/jest/pull/14826)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah, totally wrong format 😅
should be
`[jest-haste-map]` Only spawn one process to check for `watchman` installation ([#14826](https://github.com/jestjs/jest/pull/14826))
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
While looking at #14818, I noticed that we spawned a check for
watchman
for every single project as well.before:
After:
~440ms to ~8ms in this extreme example
The call to
watchman
itself is still about 14ms of course, but it happens outside of thebuild
calls. This means that if you install watchman while Jest is running, that won't be picked up. But I think that's perfectly fine.We should try to fix the
createWatcher
call as wellTest plan
CI