Jump to content

Putting a file in a disk cache.


Sfor

Recommended Posts

I'm experimenting with video playback benchmarking. Right now I'm trying to exclude the disk IO operations from the equation. It is possible to use a ramdrive of some sort, but it will be much easier for me to use some script putting a file in a disk cache, instead.

 

The computer has 2GB of RAM and I'm working with files exceeding 1GB. Copying a file from one HDD to another works, all right, but it would be better to just read the file leaving its copy just in the system disk cache. In theory, It should give me ability to get the whole file in the disk cache.

 

I've been experimenting with "copy /b filename nul" command from the cmd.exe. While it is effective in checking if the whole file is in the disk cache, it is not affecting the disk cache by itself. I do not know why, but reading a file with this command does not put the file in the system disk cache, in the same time it is able to read from the same cache.

 

For an example, I did the "copy /b filename nul" command with the same 200MB file a few times. It always reads the file from the HDD. But, after copying the file with the Windows Explorer the same command always reads the file from the cache, and the HDD LED is off, completely.

 

Well, the above observations have one flaw, however. The "copy /b filename nul" acts differently in a freshly booted system. A few first files read with the copy command are stored in the system disk cache. When there are no more unused memory, the cache does not accept any more files from the copy command. It looks like the copy command can affect the contents of the system cache, when there are still unused memory space. After that copy reads directly from the HDD.

 

It appears the Windows XP disk cache works in a very different way, from what I saw in Windows 98. It appears different applications are interacting with the system cache in different ways. And thats something new to me.

Link to comment
Share on other sites


I did perform the tests of the CacheFolder 1.0.1, and it was exactly the same as the copy command. After initial filling the RAM with cached files it was no longer able to store files in the system cache. What's more:

- I was unable to make the CacheFolder work from the command prompt. It did work from the context menu, however.

- The CacheFolder was significantly slower when reading files than copy command.

 

So, the CacheFolder works exactly the same as the "copy /b filename nul" command, but slower. Right after the system boot it fills unused RAM with files it reads, but once the free space is filled, all it does is reading data from disk without any effect on the cache.

 

I did another observation, however. After the initial filling of the free RAM with cached files, the file reading does not seem to affect the cache. On the other hand, file writes do affect the cache contents. In the experiment I did copy a file between the disk drives. After that the source file was not cached, but the target one did.

 

I did perform the same test on the Windows 2000 professional. The cache works exactly the same as it was in Windows 98, there. I mean after initial filling of the free RAM the readed files are cached, always. The older and less accessed files are removed to make space for new reads.

 

It seems the Windows XP removes older files from the cache, but only to store writes, not reads.

Edited by Sfor
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...