Is there any point implementing my own file cache in a Windows app?

236 views Asked by At

I have a Delphi app that references a datafile of 28-byte records. The file is written sequentially but read randomly. The datafile is split into N physical files which are rolled over at 10 megs or so to provide some insurance against disk problems, and because we are only ever writing to the most recent one, and I found it became slower and slower to write to if it were allowed to grow to big. On startup I read the entire file set and build an index so that I can quickly know which file to seek into given a virtual record number.

As part of the splitting into N files I implemented a read cache. I realise now that Windows does a fair amount of caching on it's own, and I wonder if I'm gaining anything by sticking another cache between myself and the disk files.

Any thoughts appreciated.

1

There are 1 answers

8
Ignacio Vazquez-Abrams On BEST ANSWER

No. Use file mappings to use the existing file cache more efficiently.