Re: [fastCache] (not the Name) - virtual?
| From: | Alan Knowles | Date: | Wed, 24 Jul 2002 00:08:41 +0000 |
| Subject: | Re: [fastCache] (not the Name) - virtual? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7928@lists.php.net to get a copy of this message | ||
Just a thought but has anyone tried using virtual($cached_file), to try and improve the performance of these caches? - obvioulsy bypassing the read data into memory.. etc.- it would probably involve adding
<!-- crc32data --> at the head..
otherwise is this any faster
$data = fread($fp, filesize($this->_file)-32));
that this
while (($tmp = fread($fp, 4096))) {
$data .= $tmp;
}
fabien.marty@free.fr wrote:
(Mika)Humm. I think that differs a bit with the naming scheme used earlier. Cache_Graphics caches graphics, Cache_Output caches output of a script. Now Cache_File denotes container (the file) and not what is cached. Some people (including me :) might find this misleading. Not a big issue though.One point for you. What about Cache_InFile or better Cache_Safe (because of tests to avoid cache corruption even on NFS) ? When the name will be ok for all, I will put it on CVS. I have updated the class on my website with : - reading control (a key 'crc32' (default) is calculated and embeded in the cache) - writing control (reading and comparing the cache just after writing it) Perfs are still ok. http://www.esub2.com/pear/fastCache.php.txt Fab