4 ms·
For the most part npm has worked for me on Windows, but it's so incredibly slow compared to even npm in a Linux VM on the same host. I understand this is mostly
by Cu3PO42 4y ago
For the most part npm has worked for me on Windows, but it's so incredibly slow compared to even npm in a Linux VM on the same host. I understand this is mostly due to FS overhead related to a multitude of small files.
Obviously this isn't a deal breaker in most situations, but it is a bit annoying. I've observed similar performance problems running Webpack on Windows in the past.
- j16sdiz 4y ago> I understand this is mostly due to FS overhead related to a multitude of small files. No. It was the VFS design. They have lots hooks and extension points for 3rd party, there is no way to improve without breaking backward compatibility. It was the reason why many antivirus was broken in the first few releases of windows 10.
- easton 4y agoThere’s a possibility this is due to corporate antivirus. Many AV solutions (seemingly not Windows Defender) scan every file that’s written, massively slowing down IO, but they can’t scan VHDs. Excluding the folder where node_modules is or running npm inside WSL2 has good performance on my work laptop, in a random windows folder not so much.
- diroussel 4y agoThere was a HN post a while back where a MS engineer was explaining why windows file system access will never be as fast as Linux.
- jmmv 4y agoAdd your npm directories to the virus file exclusion lists of Windows Defender. Note that some of the directories may not be obvious (those under AppData for example). The speed improvements are massive for tools like these that touch lots of small files. Also take a look at this talk on NTFS, file system speed, and how the presenter optimized the Rust installer: https://youtu.be/qbKGw8MQ0i8 https://youtu.be/qbKGw8MQ0i8 . There is an awful lot that can be done to tools that deal with lots of files to perform well under Windows too.