Member-only story

🚀 Node Modules Now Faster On Windows With Dev Drive

Tom Smykowski
3 min readJul 10, 2024

--

No one knows about the new feature in Windows called dev drive that can boost node_modules and other monstrosities

Windows is the operating system used the most for professional and personal stuff by programmers.

But it has some drawbacks, and while these pile up lately there’s one nice new feature that was announced like a year ago, but no one noticed it.

So, the problem with Windows is that it doesn’t expect a folder to have 100k 1KB files. To be honest no one expected it. But it occurs it’s how web applications are built.

When you use npm, or other compatible package manager, it will install all dependencies of your project into node_modules folder. Dependencies of these dependencies as well and so on.

It becomes quite clear that to develop 1MB web application suddenly you need to store Library of Congress on your computer.

Windows for years is famous for being extremely slow handling a lot of small files. Whether you use FAT, NTFS, HDD or SDD there’s always time to tinkle.

Some people blame the file format, and some Windows Defender that adds time to processing all of these files.

There are various approaches to this problem. For example pnpm is quite faster in handling node_modules compared to npm.

Other option is to create a virtual disk in the RAM and store your project there. The speed gain is impressive, a drawback is the time to copy files to that disk initially and a risk of loosing uncommitted changes in a power outage. But that one is mitigated on a laptop.

Another solution is to use WSL. It’s Windows Subsystem for Linux.

Using it solves all the problems with non cross system project configurations and improves performance.

But there’s even newer solution offered by Windows itself that directly addresses this problem.

I’ve learned about it from Wojciech Maj. It occurs a year ago Microsoft added a feature called a dev drive.

It is a special virtual drive specifically prepared for programmers. It uses a new file format…

--

--

Tom Smykowski
Tom Smykowski

Written by Tom Smykowski

Hi! My name is Tom Smykowski, and I’m a Staff Frontend Engineer. Grab a free scalable Angular app checklist: https://tomasz-smykowski.com/scalable-angular

Responses (2)

Write a response