Classic Computer Magazine Archive COMPUTE! ISSUE 137 / JANUARY 1992 / PAGE S13

How to optimize your PC with DOS 5.0 (MS-DOS Featuring DOS 5.0)
by Mark Minasi

DOS 5.0 is exciting because of its possibilities but frustrating because of its breadth. You feel like there are lots of neat things that you could get out of it, but you fear that you're missing something. Here's a summary of what you should do to get more speed and functionality from your PC under DOS 5.0.

1 Speed up your disk with BUFFERS. FASTOPEN, and SMARTDRV (or some other cache program).

2 Check your hard disk's best interleave factor under DOS 5.0.

3 Get more memory for your DOS programs with the DOS memory-manager programs.

4 Free up some wasted memory by tuning your STACKS, FCBS, and LASTDRIVE values.

5 Speed up DOS redirection with a small RAMDRIVE.

6 Get more from your video system with ANSI.SYS, unless it slows down your applications.

7 Speed up your keyboard with MODE.

8 Protect your data investment with MIRROR's preventive maintenance tools.

Several of these topics are covered in more detail in other articles in this booklet, in particular "19 Top DOS 5.0 Tips" and "How to Manage Memory With DOS 5.0," so I'll focus on DOS 5.0's disk optimization in this article.

Time for a Tuneup

If you've worked with a PC for more than a few months, you've heard that various kinds of black magic can squeeze more speed from your hard disk. In particular, you can speed up a disk by (1) ensuring that the disk is formatted to its optimal interleave factor, (2) unfragmenting your disk periodically, and (3) running a disk-caching program. DOS 5.0 provides utilities for the second of these techniques. It offers nothing for the first and third, but it may affect the performance of the first.

A disk's interleave factor refers to two disk terms--track and sector. A track is a circular area on a disk, much like the lines on an album. (You remember albums--they look kind of like CDs, except that they're larger and made out of a shiny black plastic? We used to put them on "turntables" to play them back when I went to college--ahem--years ago.)

Sectors are small wedges on those tracks. Typically, a hard disk has from 17 to 100 or more sectors on a track. Think of sectors as sitting around a circular track in the same way that numbers sit around a clock face. Sectors are numbered from 1 to 17 (or whatever).

Unlike the numbers on a clock face, however, sectors can be arranged in virtually any order. It may seem nonintuitive, but this scattering of sector order is necessary to optimize the rate at which your system can pull data from your hard disk.

That sector ordering--the interleave factor--is determined when your disk is low-level formatted, something usually handled by your dealer. (By the way, this has nothing to do with the seek time or access time of your disk. That's something that's determined by hardware design, like the maximum speed on your car.)

You should care about this because many computers sold between 1984 and 1989 were formatted with incorrect interleave factors, robbing them of optimum performance. (Most of today's computers come with drives that either are already set correctly or are of a type called IDE, which doesn't allow you to change its interleave factor.)

So a market sprang up for interleave-fixer programs. Perhaps the best known is SpinRite II from Gibson Research. IF you have such a program, run it again now that you're running DOS 5.0. Because DOS 5.0 affects disk I/O, it can change the optimum interleave factor for your computer, particularly if your computer runs at 10 MHz or slower.

How you arrange the sectors on a track affects your disk's performance, but the disk's performance is also affected by how you arrange the data on those sectors. Disks that are nearly full are candidated for data fragmentation, wherein a disk file could be stored in pieces scattered all over the disk. You can find fragmented files in a given subdirectory by typing CHKDSK *.*. DOS 50 doesn't come with an unfragmenting program, but there are lots of them around. If you own a copy of PC Tools, type COMPRESS; if you own Norton Utilities, type SD (for Speed Disk). Or buy FastTray or Disk Optimizer. Run an unfragger program about once a month.

Cache and Carry

Third in our disk-speedup list is the question of a cache--pronounced "cash." (Say "cachet," as I've heard some do, and you'll get snickers.) The whole idea of a cache is based on the relative speeds of a computer's memory and hard disk. The CPU can typically read a byte of data from the memory in just under half a microsecond (a microsecond is one millionth of a second). Reading a byte of disk data, on the other hand, typically takes about 30,000 microseconds. That means disk accesses are painfully slow, from the point of view of the CPU.

That's where the cache program comes in A cache program sets aside a bit of memory, generally from 256K to 2MB of RAM, as its scratch pad space. Then it monitors how you use your disk, figures out which of the areas of disk you use most frequently, and determines which you may soon need. It then stores the data from those disk areas in its scratch pad space. Then, when a program needs some data from the disk, the operating system first checks with the cache to see if the desired data is already loaded into the cache. If it is, all DOS needs to do is transfer the data from the cache scratch pad--a memory area--to the application needing the data--another memory area. Memory-to-memory transfers are, as you'd imagine, tons faster than disk-to-memory transfers.

There are a lot of cache programs available from third parties, but DOS caches with three commands: BUFFERS, SMARTDRV.SYS, and FASTOPEN.COM. Caching is a very good idea to speed up your system. The DOS 5.0 tools aren't bad, but they're not the best speed-up tools around. If you use SMARTDRV, allocate from 512K to 1024K of extended memory for it. Ste your BUFFERS at about 40, as they no longer take up lower DOS memory space--they load to the HMA automatically when you use DOS=HIGH in your CONFIG.SYS. And experiment with FASTOPEN to see if it speeds up your disk accesses; if you decide to use it, load it high, as it works fine there and won't end up chomping on your conventional memory.

And now that you've gone to all of that trouble of speeding up the disk, take a minute to protect it by putting MIRROR in your AUTOEXEC.BAT. You can take a took at "How to Use the New DOS 5.0 Disk Utilities" for more info.