On Wed, Jul 26, 2006 at 03:12:02PM -0400, David Golden wrote: > What's the advantage of implementing your own read caching instead of > letting the OS handle it? Will this effectively cache twice, once > manually and once by the OS, and cost double memory?
The main aim was for caching small files that are read very often, where we don't care to get up-to-the-second latest data, as long as we notice changes after a short while. I use this in parsing ".htaccess"-like files, for example. Small config files that need consulting all the time. I find that having a function to return the contents in a bare string cached in memory is a lot faster than bothering the OS with a complete open/read/close cycle. Though ovbviously its use in large files that are rarely accessed is likely to be of little benefit. -- Paul "LeoNerd" Evans [EMAIL PROTECTED] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/
signature.asc
Description: Digital signature