From: kunst AT prl DOT philips DOT nl Subject: Re: Disk I/O rates with DJGPP To: S DOT D DOT Smith AT ecs DOT soton DOT ac DOT uk (Sean Smith) Date: Wed, 2 Nov 1994 13:43:52 +0100 (MET) Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP users list) S D Smith writes: > > A colleague of mine who is also using DJGPP has commented that the disk I/O > (low level) for DJGPP objects is substantially slower than native > Windows or DOS I/O. The comment is that e.g. Zortech C/C++ can produce > binaries that give block reads and writes of large blocks at up to > 400kbs-1 while despite the chosen blocksize DJGPP low level reads and > writes reach a ceiling at around 30kbs-1. Obviously there is some > h/w dependency here, but I guess the ratios are comparable whatever the > hardware. > > I'm just off to look at the sources for read/write now, but does anyone > have any comments on this? > GO32 uses the (real mode) DOS routines for disk I/O. DJGPP programs that read from/write to disk have their (protected mode) data transfered to the real mode region using a 4096 byte transfer buffer. (The exact buffer size might have been altered in recent GO32 versions.) Then the DOS disk I/O routines are called to do the actual disk access. There is thus a speed penalty due to data transfer and switching from/to protected mode for each chunk. And no, using setbuf() doesn't help you much... Pieter Kunst (kunst AT prl DOT philips DOT nl)