Re: Benchmarking PHPA and Cache_Lite

From: Date: Wed, 12 Feb 2003 17:48:50 +0000
Subject: Re: Benchmarking PHPA and Cache_Lite
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-13198@lists.php.net to get a copy of this message
> What it is, is some benchmarks of different combinations > of different PHPA setups with and without additional > output cache provided by PEAR Cache_Lite. Hum... first, this study is great :-) but... I think that Cache_Lite can be really faster. If you have a look at the Cache_Lite code (or technicals docs), you will note that I don't include PEAR.php for speed reason ! Indeed, the inclusion is dynamic (with include_once and not require_once) when an error occured but PEAR.php isn't included in most cases. With this system, the speed jump is very important. So I will rewrite "Select 1000 with output cache" for example like this : <?php $id = '1000_cached'; require_once('Cache/Lite/Output.php'); $cl = new Cache_Lite(); if (!($cl->start($id))) { PEAR::setErrorHandling(PEAR_ERROR_PRINT); include_once('PEAR.php'); include_once('DB/DataContainer.php'); include_once('Test/dbConnection.php'); include_once('Test/Container.php'); $params[classname] = 'test_container'; $params[table] = 'test1'; $params[limit] = 1000; $testcontainer = Test_Container::getObjects($dbh, $params); echo('<html><head><title></title></head><body><pre>'); foreach ($testcontainer as $tc) { print $tc->getData1() . "\n"; print $tc->getData2() . "\n"; } echo('</pre></body></html>'); $cl->end() } ?> IMHO, it will be a lot faster... :-) Fab PS : I will try to make some benchs of it

« previous php.pear.dev (#13198) next »