Curiosity about file access performance

Eliot Moss moss@cs.umass.edu
Fri Oct 29 10:58:45 GMT 2021


On 10/29/2021 11:44 AM, Adam Dinwoodie wrote:

> AIUI it's a fundamental part of the trade-offs that NTFS makes:
> compared to common Linux file systems like ext4, NTFS is much slower
> at things like parsing directory structures (which is a necessary part
> of opening any given file). In the same way that native Windows
> programs tend to use threading implementations that work differently
> to fork(), native Windows applications will also often much prefer
> large monolithic data files, where native *nix applications are much
> more likely to have lots of small files. As a result, for things that
> require opening lots of files, WSL (at least if you're using the
> native WSL disk, which will be a *nix disk image stored in a file,
> rather than files under /mnt/c or similar) will likely be quicker than
> a similar operation through Cygwin, as Cygwin will always be affected
> by those NTFS overheads.

Ah, that's interesting.  The files in question, that seem to be opened
(and *maybe* read) faster are in the *nix hierarchy, while my book files
are all in Windows (/mnt/c on WSL1).  So the huge speedup reading those
makes sense.  The speedup processing the rest still doesn't quite make
sense, unless maybe WSL1's parsed-directory caching is more effective
than Cygwin's or something.  (I assume something like that is going on,
to reduce conversions of directories to *nix format.)

Regards - Eliot


More information about the Cygwin mailing list