Mail Archives: cygwin/1998/04/02/20:10:53
Jacob Langseth <jlangseth AT esisys DOT com> writes:
> [message about slow file I/O]
After encountering some similar problems with file I/O in B19 being
a real dog, I fiddled with STRACE a bit and then dug around in the sources,
and determined that most of the file I/O being done in B19 gets done in 1K
chunks! This works just fine on a local NTFS drive, but it blows on a FAT
drive and causes at least a 50% (sometimes 70-80%) slowdown over our
network, as compared to unfiltered win32 calls.
The solution, if you can use it, is to change the code to use the
system fileIO calls instead of the stream calls, and use the largest blocks
you can. read(bighonkinblock) and write(bighonkinblock) consistently
outperform fread() and fwrite() on this platform. Unfortunately, many of
the fileutils and other supplied tools use stat()/fstat() to figure out the
blocksize of a file, and mistakenly assume that this will be the most
efficient size to use. Windows internally mangles all I/O requests, so
messing around with blocksizes when reading/writing the files just thrashes
the cache instead of accomplishing what it should.
Careful examination of the winsup sources revealed that we didn't
really want to mess with them :), so we are just living with the slowdown
and trying to make sure that our internal tools don't use fread() to get
large files over the network.
-dave ________ _______ ____
---------------------------------------------/_ \ \/| ___ \ \- -
David O'Riva - Staff Programmer /| |\ \| ____/ /\ \
oriva AT agames DOT com /| |/ /| |\/\ \/ /\
__|_____o/|__o\ /\____o\
---/________\/____\--/____\-- -
DISCLAIMER: Any opinions expressed here are mine, *not* my employer's.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -