Windows 7 (Vista) ReadyBoost, Prefetch and Superfetch

On spare times, I started to look into Windows 7 (Vista) new features on using caching on faster storage device (ReadyBoost) and also tried to understand what Prefetch and Superfetch does.

I realized that Microsoft is moving  aclassic "tiered storage" architecture (without going up to expensive SSD drives, one may buy a memory card and get similar boost by caching there the most used programs) which may be quite relevant to our work. However, the feature is not trivial to enable and performance gain are not immediate. Here is what I know.

Basis

See this article for a general broad overview of the IO imporvement technology.

  • PreFetch      - old XP mode with prefetch data in some system directory - default value for this setting is 3 (prefetch boot and runtime program) and there has been tones of articles over the past decades spekaing of tweaing those (changing to 2 or even "undocumented" values of 5) to speed things even better. From my own experience with XP (tried all of that), I saw little to no change (very subjective and not stable over time) so I would not change the value at all.
  • SuperFetch  - this is a new mechanism starting with Windows Vista. It preloads apps in memory  - the default value 3. Superfetch improves on Prefetch by monitoring which applications you use the most and preloading those into your system memory so they will be ready when you need them (quote).

The default values are

    0 = Disabled
    1 = Application launch prefetching enabled
    2 = Boot prefetching enabled
    3 = Application launch and boot enabled
 

ReadyBoost

Windows Vista and Windows 7 can use alternate storage such as USD flash drive or SD card to access program, hence freeing up main memory. Although hard disks usually have higher data transfer rates, flash drives can be faster for small files or non-sequential I/O because of their short random seek times. This is where the things become complicated.

First, programs are loaded (copied) into the ReadyBoost device and read many times. This implies that a focus should be given to the read time.

Second, one need to test the non-sequential nature of the transfers.

Third, MS gives those guidances:

  • The device must have an access time of 1 ms or less.
  • The device must be capable of 2.5 MB/s read speeds for 4 KB random reads spread uniformly across the entire device, and 1.75 MB/s write speeds for 512 KB random writes spread uniformly across the device.

And several blogs and Microsfot WebPages (as well as the Wikipedia article on ReadyBoost) suggests a testing using the commands

  • To test random reads (4096 for 4 KB):
    CMD> winsat disk -read -ran -ransize 4096 -drive driveletter
  • For random writes (524288 for 512 KB):
    CMD> winsat disk -write -ran -ransize 524288 -drive driveletter
  • I also used CrystalDiskMark, a 50 MB, 4 K Read test, 5 passes for comparison and the IOPs for the 4 K test

Now, let us look at a few results and see how this varies along several devices.

Tests

 Using the winsat results, here are a few number to illustrate the issue and wide range of external/internal device one can use. All were performed on a Sony VAIO VPCS137GX model (with all bells and wistles when it comes to the SD cards).

Device Write Read CDM 4 K
Random Read
CDM IOPS
Internal disk drive
SAMSUNG HM641JI, SERIAL ATA, ATA8-ACS version 6
44.86 MB/sec 00.33 MB/sec 01.05 MB/sec 108
External USB stick
Dane-Elec 2 GB Flash (relative low performance but cheap)
02.21 MB/sec 05.52 MB/sec 05.33 MB/sec 1301
External USB stick
From Verbatim
02.01 MB/sec 05.88 MB/sec 04.33 MB/sec 1051
SD Card #1
Sony SF-4N4 4 GB SDHC Card
This is a class 4 SD card (
a minimal for SDHC video), 4bits parallel interface
01.21 MB/sec 01.05 MB/sec 01.32 MB/sec x
SD Card #2
Sony Memory Stick PRO DUO, 4 GB, Mark 2
01.36 MB/sec 02.29 MB/sec x x
SD Card #3
Transcend, 8 GB Class 6 Card TS8GSDHC6
01.41 MB/sec 03.79 MB/sec 03.87 MB/sec 944
SD Card #4
Sony PRO-HG DUO HX, MSHX8A
Advertized as 30 MB/sec and x3 a normal PRO DUO, 8 bits parallel interface
02.13 MB/sec 06.55 MB/sec 07.56 MB/sec 1854

 

NB: most SD cards comes formatted as FAT. A near undocumented feature is that Vista/Win7 will not offer ReadBoost until you reformat as NTFS.

  • Even a low-end external USB drive reaches the recommended 2.5 MB/sec read and  the 1.75 MB/sec write. The read shows that if the data is read randomly, the benefits would be immediate and comparing to the internal drive, provide a factor of near x17. Write would be slow (but again, this is a write once read many time mechanism)
  • Note the dramatic difference in IOPs as devices are tested - the lowest being a standard drive, USB or SD cards are near x10 faster with a blazing speed for the PRO-HG DUO HX (17 times faster than a drive).
  • A common camera class 4 SD card would NOT do. It is very far from reaching the base requirements (one has to be careful not to jump to fast conclusion such as SD card = fast).
  • A standard PRO DUO SD card grazes the performance requirement (and is noticeably better than a standard SD card) but you need at least a Class 6 SD card or better to make it viable.
  • The PRO-HG DUO HX is indeed ~ of a factor of x2 faster than a normal PRO DUO card and better than a Class 6 SD card. It performs better than a USB stick, making it a good candidate for a convenient memory card for ReadyBoost (if you can afford the price difference).