The same build takes twenty seconds on Windows and four minutes in the subsystem: is that expected?
Same project, same machine, same commands. Run it natively on Windows and it is fast. Run it in the Linux subsystem and it is unusably slow, installs, builds, test runs, everything involving lots of files.
CPU is not pegged. Disk is not obviously busy. It is just slow in a way that scales with the number of files rather than with the amount of work.
My project lives on my Windows drive and I access it from Linux through the mounted path, because that is where my code has always been and my editor is a Windows application.
Is this a known thing, and is there a way to have both: a fast Linux environment and my files where they are?
@filesystem_boundary · 3w ago
Known, expected, and the cause is exactly what you deduced: you are crossing a filesystem boundary on every file operation.
When the project lives on the Windows drive and Linux reaches it through the mounted path, every open, stat and read goes through a translation layer between two different filesystems with different semantics. One file is fine. A dependency install touching tens of thousands of files pays that cost tens of thousands of times, which is why the slowdown scales with file count and not with work done.
It is not a misconfiguration and there is no setting that makes it fast. It is the architecture.
The fix is to keep the files on the Linux side. Move the project into your Linux home directory rather than accessing it through the mount. The same install that takes minutes across the boundary typically takes seconds natively, and the difference is not subtle.
The rule to carry: work where the tools are. Linux tooling on the Linux filesystem, Windows tooling on the Windows filesystem. The mounts exist for moving things between the two occasionally, not for living on.
Which leaves your editor, and that is the good news - see below, because you do not have to give it up.
Reply
Report