[comp.sys.ibm.pc.hardware] Simple Cache Question

chau@caen.engin.umich.edu (Hin Fai Chau) (06/03/91)

This has long been a question in my mind.  Can anyone please
tell me whether I still need to install FASTOPEN and SMARTDRV
or other disk cache programs such as HYPERDISK if I have
already had a 32 K cache buffer in my disk controller card
and another 64 K in my 386 processor?
Does a software disk cache program actually create extra
overheading if I have already got a hardware one?

Thanks in advance.

Hin-Fai Chau
chau@caen.engin.umich.edu

town@hpspkla.spk.hp.com (Brian R. Town) (06/04/91)

In comp.sys.ibm.pc.hardware, chau@caen.engin.umich.edu (Hin Fai Chau) writes:

>   This has long been a question in my mind.  Can anyone please
>   tell me whether I still need to install FASTOPEN and SMARTDRV
>   or other disk cache programs such as HYPERDISK if I have
>   already had a 32 K cache buffer in my disk controller card
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is VERY small as far a disk caches go.  I think that you would benefit
from running cache software.  To cache or not to cache (and how much memory to
use) depends upon what software you run, what you would be doing with the extra
memory the cache is going to tie up, etc.  It usually comes down to doing a
little experimenting with the software you typically run to find the best fit.  

>   and another 64 K in my 386 processor?

This is CPU cache and has nothing to do with your disk performance, at least in
practical terms :^) 

>   Does a software disk cache program actually create extra
>   overheading if I have already got a hardware one?

Yes, there is extra overhead, but this does not really apply here.  It isn't
really a case of duplicate effort when your hardware only has 32K of cache.
The outcome of having a software cache will (for most applications) be an
improvement in performance, so does it really matter if there is a little
duplication of effort?  The hardware cache is probably so fast anyway, that
the extra performance it adds pretty much comes for free.  If I were you, I
would see about getting more memory on your hardware cache.  That would be
even better, especially if you would have to buy more memory for your machine
anyway in order to have enough for a software cache.

>   Thanks in advance.

Hope this helps.

>   Hin-Fai Chau
>   chau@caen.engin.umich.edu

Brian (I'd never be caught without cache) Town
town@hpspkla.hp.com

pshuang@ATHENA.MIT.EDU (06/07/91)

In answer to your e-mail questions:

o Cache hit ratios cannot easily be measured by programs other than the
cache software itself.  Many (but not SMARTDRV) have a report option
where you can see the current hit ratio for this session.

o Windows does *NOT* ever require you to set SMARTDRV to a large amount,
although it does require you to use HIMEM.SYS; are you confusing the two
different drivers?  Caches tend to top out at about a megabyte;
dedicating more memory than that usually doesn't help performance more
than a tiny fraction, and is not worth it.

o Software tends to run faster directly under DOS than under Windows for
several reasons.  Windows is intercepting all hardware accesses and
mediating to make sure that your DOS application isn't trying to use the
hard disk or writing to video or accessing communications ports at the
same time that another application is, and this eats up CPU cycles.
Also, being in virtual-86 mode of the 80386 (Windows 3.0) as opposed to
being in the real mode (DOS alone) slows down memory access.  The 80386
virtual and protected modes allow hardware protection for memory
accesses so that multitasking programs cannot trash each other as easily
as they might otherwise, but the cost is that instructions which access
memory often run slower due to overhead in checking to make sure that
the program is allowed to access that part of memory.

Singing off,
UNIX:/etc/ping instantiated (Ping Huang).

n65j@vax5.cit.cornell.edu (06/07/91)

In article <RL0+Y0.@engin.umich.edu>,
chau@caen.engin.umich.edu (Hin Fai Chau) writes: 
> This has long been a question in my mind.  Can anyone please
> tell me whether I still need to install FASTOPEN and SMARTDRV
> or other disk cache programs such as HYPERDISK if I have
> already had a 32 K cache buffer in my disk controller card

Depending on the type of software you are using you can still see major
performance gains from the additional disk cache software.  32K is a very small
cache to hold repeatedly-accessed data such as the file allocation table and
directory data, let alone any of your own files that might be repeatedly
accessed during something like a database search or the compile of a large
multimodule program.  If your main use is for small spreadsheets, however,
you wouldn't be using the drive much in the first place and even the controller
cache would be underused.  This is only the tip of the iceberg of explanation,
but the bottom line is probably that the software cache could very well
improve your system's performance if your computer uses now involve repeated
reading of the same directories or files at short intervals.

> and another 64 K in my 386 processor?

This caches the transfers of data between the microprocessor and the main
memory, so it does not have anything directly to do with the controller
or software disk cache.

> Does a software disk cache program actually create extra
> overheading if I have already got a hardware one?

It again depends on how your application software makes use of the disk.

Let me suggest an empirical test that sold me on disk cacheing.  Get Hyperdisk
from a BBS or a FTP site like SIMTEL or WUARCHIVE, and try it.  Since it is
shareware, you don't have to pay to try it out.  When I first started
using a cache, I had been bothered by extensive disk activity (head seeking)
during Turbo Pascal compiles.  Many small files had to be accessed repeatedly,
and it seemed to take forever to compile some multi-module programs.  I 
installed a cache (PC-CACHE which comes with Central Point's PC Tools) and 
the drive became practically silent as the compiler had only to refer to the 
cached copy of the many small files after the first time, instead of having to 
wait while the heads zipped all over the place.  I saw similar results with 
dBase III, which often uses a lot of files, repeatedly.

-- regards, Steve Pacenka, Cornell U.