Huge speedup to wine ReadFile on small packets

Hannu Kotipalo hannu.kotipalo at
Mon Nov 11 14:03:06 CST 2002

Hash: SHA1

Tony Lambregts kirjoitti Maanantai 11. Marraskuuta 2002 07:58:
> >
> >On Maanantai 11. Marraskuuta 2002 00:49, you wrote :
> >>Well I tried it out with a couple of programs. Things seemed ok with
> >>small files but when I tried to run SimCity 3000 (just one of my test
> >>programs) It freezes up when loading a city (not a crash).  I will try
> >>to see why when I get a chance.
> >
> >I think that the size shouldn't be a problem; wzebra reads out a 17 Mb
> > file... The problem might be that there is only one buffer. If the
> > program reads two files in turns, my code switches the buffer for every
> > read. This is actually slower than without. Maybe it is not freezed,
> > maybe it is just too slow? Another problem might be the buffer switching
> > code.
> Well from what I can see it is opening a lot of little files along with
> the big file so it is slowed down to a crawl not frozen. and with trace
> on... I think you need more than one than one buffer perhaps. One per
> file of course.  Havent looked that close...

I'll make a version with more, but smaller buffers. I found one bug also; on 
certain case, a closed file's buffer might has been used for the next opened 
file with same HANDLE. Where is CLOSEFILE code?! Shouldn't it be on file.c?
I need to find it to invalidate the buffer at correct place!

I think that the original problem is that wine opens and closes unix file for 
every ReadFile. This will propably flush all linux own buffers and linux 
filesystem has to read the same data over and over again (when application 
calls ReadFile with small buffers, of course). Opened unix files should be 
kept open as long as corresponding WINAPI files are open.

BTW. I'm using totally non-MS system. Is there any problem with MS dll's?


 Could you PLEASE add following line to the mailing list archive configuration
- ------------------
spamprotect = 1
- ---------------

Version: GnuPG v1.2.1 (GNU/Linux)


More information about the wine-devel mailing list