Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!ames!amdcad!sun!imagen!atari!apratt From: apratt@atari.UUCP Newsgroups: comp.sys.atari.st Subject: Re: Disk R/W times for large files Message-ID: <781@atari.UUCP> Date: Mon, 6-Jul-87 20:08:43 EDT Article-I.D.: atari.781 Posted: Mon Jul 6 20:08:43 1987 Date-Received: Thu, 9-Jul-87 02:12:58 EDT References: <383@uop.UUCP> Organization: Atari Corp., Sunnyvale CA Lines: 46 in article <383@uop.UUCP>, exodus@uop.UUCP (Greg Onufer) says: > > Anybody care to explain what's wrong here? > > I used GULAM's timing function to time misc. file copies onto several > formats of disk. The tables should explain: > Big files will copy fast only if big reads and writes are used. If your copy program reads one sector, writes it to the floppy, then reads another sector, you'll lose. The shell we shipped with the developer's kit a while ago, called COMMAND.PRG, used a 1000 (not 1K) byte buffer. This is a real problem. Big reads are optimized to read a whole track at a time (for instance). When this is the case, sector skewing will LOSE, because it takes multiple revolutions to read the whole track. For operations like file copy, the lesson is to use as big a buffer as you can. Don't create a static 8192-byte array: instead, determine how much memory you have available and use all of it. Here is a little code in Alcyon C (this depends on the variable _break, set up by gemstart and changed when you use gemlib's malloc). It returns the number of bytes available starting at _break, and that stays valid as long as you do no function calls (especially not to gemlib's malloc()). long freemem() { extern long _break; long dummy; /* &dummy is something near the current sp */ return (&ret - _break - 512); /* 512 is a chicken factor */ } If you have used Mshrink to return memory to the operating system (which is the case if you set the STACK variable in gemstart.s to 0, 1, 2, or 3), you may have more memory than this available using Malloc (the OS call). Malloc(-1L) returns the largest Malloc request which can be satisfied. If you Malloc this, use it as a disk buffer, then Mfree it, you will not run into trouble. /----------------------------------------------\ | Opinions expressed above do not necessarily | -- Allan Pratt, Atari Corp. | reflect those of Atari Corp. or anyone else. | ...lll-lcc!atari!apratt \----------------------------------------------/ (APRATT on GEnie)