-
Notifications
You must be signed in to change notification settings - Fork 19
Description
npm and yarn are the bread and butter of package management for the nodejs ecosystem, of which react-native is a part of.
Yet, these tools are very slow and finnicky on Windows. There are many stackoverflow posts about people asking why yarn is so slow.
We feel this pain ourselves too (RNW team) and we hear it from people coming form mac OS or Android and wanting to add Windows versions of their RN apps.
I recently added a CI loop in github actions, that does the exact same thing for a popular 3rd party npm package I contributed to (envinfo): install yarn dependencies, build the typescript, run the package.
What I saw was that Windows took 4 times as long as ubuntu to do end-to-end install of the package and running it once.
I imagine part of it is that the yarn/nodejs implementation is suboptimal on windows, but it seems that even github actions is spending a lot more time doing things on Windows that aren’t “run the user’s code” than on Ubuntu.
What's worse is that the ubuntu virtual hardware seems a lot less powerful than Windows', so the actual measure is probably a lot worse than 4x.
Here are my measurements:
| ubuntu | Windows | |
|---|---|---|
| Set up job | 2s | 1s |
| Run actions/checkout@v2 | 1s | 26s |
| Use Node.js 10.x | 1s | 15s |
| Run yarn | 43s | 2m 19s |
| Run node --unhandled-rejections=strict src/cli.js | 18s | 1m 0s |
| Post Run actions/checkout@v2 | 0s | 17s |
| Complete job | 0s | 0s |
| Total | 65 | 258 |
| 3.97x | ||
| Machine class | Standard_DS2_v2 | Standard_D4_v2 |
| vCPU | 2 | 8 |
| Memory | 7 | 28 |
| Temp storage | 14 | 400 |
| Max temp storage throughput: IOPS/Read MBps/Write MBps | 8000/64 (86) cached 6400/96 uncached | 24000/375/187 |
| Max data disks | 8 | 32 |
| Throughput: IOPS | 32x500 | |
| Max NICs/Expected network bandwidth (Mbps) | 2/1500 | 8/1/6000 |