[Win32utils-devel] nread and nwrite optimizations

win32utils-devel at rubyforge.org win32utils-devel at rubyforge.org
Thu Nov 18 00:26:28 EST 2004

> Hi all,
> So far, so good.  Things seem to work just fine and, in the case of
> nread, I am getting incredible performance.  I can't tell if this is due
> to some kind of caching, however.
> Anyway, there a couple of things I want to work out yet.  The first is
> File#nread and Really Big Files.  I created a 500 mb text file and
> sucked it into memory using Ruby's File#read method just fine.  However,
> when I tried to use File#nread, it eventually died with a memory
> allocation error.  Since I have 1GB of RAM (and wasn't using much), I'm
> not sure why it would complain.
For me, the memory allocation always return sucess. Even if  625 mb file
> The second issue is getting FILE_FLAG_NO_BUFFERING to work.  Mostly I
> just want to see if this will lead to a significant performance increase
> with reads and writes.  But, using it has certain requirements that I
> don't totally understand.
It seems that Reading the whole data with one ReadFile using FILE_FLAG_NO_BUFFERING is not working for large file.

Refer to http://www.winimage.com/readfile.htm
It contains source code and shows various ReadFile methods.

> Any ideas for these two issues are definitely welcome.

Park Heesob

--MIME Multi-part separator--

More information about the win32utils-devel mailing list