You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File map: Use worker threads rather than child processes, remove watcher.unstable_workerThreads (#1639)
Summary:
Pull Request resolved: #1639
Improve startup performance (especially on Windows) by having the file map use threads rather than child processes to distribute large workloads.
In telemetry for humans running Metro at Meta on Node 22, for cases where there are enough files to process to create a worker pool:
Creating a pool of threads vs child processes is:
- 1.7x faster on macOS
- 3.8x faster on Linux
- **150x** faster on Windows (6.5s -> 43ms)
Processing files on threads vs child processes is:
- 1.4x faster on macOS
- 1.5x faster on Linux
- **3.6x** faster on Windows (18s -> 6s)
NOTE: There is a separate worker threads configuration for *transform* workers which we've also been experimenting with, I'll come to that separately.
Changelog:
```
- **[Performance]** Use worker threads for processing file changes on startup, significantly faster on Windows
```
Reviewed By: vzaidman
Differential Revision: D90510232
fbshipit-source-id: ce4bf7503832e96ad5159e4acdc0ce7f050f2f07
0 commit comments