by toast0 · 1w ago · 0 comments
Procees creation in NT is slow, but many applications can be designed to avoid it. Process creation is a bottleneck on Unix/Linux as well, the bottleneck is just usually not a big deal until you're trying to fork thousands of times per second... Then you have to do the same work you'd have done on NT to avoid forking.
This is also complicated by the fact that NT tends to orient operations around handles, but win32 deals in names. So the win32 to NT translation step often has an extra CreateFile or two.
Also filesystem drivers are kind of heavy on windows, and compared to Linux VFS they have more caching and stuff that gets applied globally. I believe, for example, that on Linux you get the name to inode caching from the VFS layer, and in windows it lives in ntfs.sys. You can read that contrast as Linux allowing performance focus in the right layer and Microsoft bolting on non-essential bloat and complexity in the FS driver.
(Also, hello.)
NTFS isn’t slow per-se, but it’s very slow at accessing a shit ton of small files. If your workflow requires that, then it’s slow on windows. Slower than you would think.
File operations in NT are implemented using a very generalized model of IRPs (IO Request Packets) that are routed through (possibly) multiple layers of filters. It's very generic and extensible, but not fast.
They actually had to add a layer of shortcuts ("Fast IO") that bypasses this for a limited set of data operations, but not for metadata. This layer just uses classic tables of function pointers instead of IRPs, just like in Linux.