Disk Cache: Macintosh compared to IBM PS/2

A caching device driver is included with the new IBM PS/2, models 50-80.
This cache uses a technique that fetches either 2, 4, or 8 sectors (user
selectable) when an I/O is issued for a single sector. This method appears
to achieve significant performance improvements with relatively small cache
sizes. Some have asked whether Apple (or other vendor) is looking at
improving the Macintosh's disk performance this way.

Apple's disk caching is not done like IBM's, for two reasons. The first
has to do with hardware: the IBM can access a multiple number of blocks
in just about the same time it can access just one. We can't do that with
our drives; we have to monitor the reading of each block.

Second, Apple has a very complicated file format and directory structure
that can't compare to the IBM disk format. The Macintosh is constantly
loading in small resource segments (often much smaller than one block) and
maintaining a complex B-tree catalog structure. Our disk cache is optimized
for this type of structure.

Basically, the way the cache works is to remember recently-written blocks
of data. It can be thought of as a "post-written" system, rather than a
"read-ahead" system. If we need that information again soon, we can
retrieve it from the cache rather than from disk. However, we can do some
read-ahead, as some hard disk controllers maintain a track buffer,
reading in an entire track at once and doling it out to the Macintosh
one block at a time.
Published Date: Feb 18, 2012