RE: [PEAR-DEV] Cache_Lite 1.0 ?
| From: | Dave Viner | Date: | Wed, 06 Nov 2002 17:12:15 +0000 |
| Subject: | RE: [PEAR-DEV] Cache_Lite 1.0 ? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-10505@lists.php.net to get a copy of this message | ||
Thanks for the pointer on fastCache instead of Cache_Lite. I'll re-read the
archives for it.
"
Cache_Lite (despite the name) isn't an optimized little version of Cache. It
was completly redesigned from scratch to get big perfs. Moreover there are
some
features (like a big protection against cache corruption) which are not
included into Cache. Because these features are only usefull for high
traffic
web sites.
So, IMHO, a real merge isn't possible because goals are really different.
"
First, wouldn't Cache benfit from "protection against cache corruption"? If
this feature is useful for a high traffic site, isn't it also useful to a
low traffic site? I mean, such a feature might not be *required* by a low
traffic site, but I don't think it would hurt a low traffic site.
Second, what are the goals of Cache_Lite and Cache? I can't seem to find
that in the docs for either.
Thanks for helping me understand the differences.
dave
-----Original Message-----
From: fabien.marty@free.fr [mailto:fabien.marty@free.fr]
Sent: Tuesday, November 05, 2002 11:19 PM
To: Dave Viner
Cc: pear-dev@lists.php.net
Subject: RE: [PEAR-DEV] Cache_Lite 1.0 ?
> sorry, i can't seem to find the earlier discussion on
>
> http://marc.theaimsgroup.com/?l=pear-dev&w=2&r=1&s=Cache_Lite&q=b
> can you point me to it?
Indeed, you have to make a search with fastCache and not Cache_Lite because
it
was the firt name proposal.
> In the meanwhile, let me ask another question. If Cache_Lite provides
> file based caching, and Cache provides file based caching, and Cache_Lite
> is truly 4x faster, why not replace Cache's file based container with
> Cache_Lite's container?
Because, the file container of Cache_Lite isn't really faster than the Cache
one. But as Cache_Lite is designed ONLY for a file container, this container
is
embeded in the Cache_Lite "kernel". So, you can get a really big jump of
perfs.
> I mean if including PEAR.php dynamically only when necessary is a good
thing
for Cache_Lite, isn't it a good thing for Cache as well?
PEAR.php provides two big things :
- error handling
- destructor emulation
The Cache class uses these two things and starts with :
class Cache extends PEAR
{
So the Cache class has to include PEAR.php each time.
Cache_Lite doesn't use destructors so it's possible to include dynamically
PEAR.php only when an error is triggered.
> I am relatively new to the PEAR world, but I am having trouble
> understanding the arguments.
Not a problem :-)
> (In my mind, Cache_Lite provides a subset
> of functionality provided by Cache. The implementation of that subset
> apparently is better than the implementation provided in Cache. Why
> not improve Cache and Cache_Lite by sharing the implementation?)
Cache_Lite (despite the name) isn't an optimized little version of Cache. It
was completly redesigned from scratch to get big perfs. Moreover there are
some
features (like a big protection against cache corruption) which are not
included into Cache. Because these features are only usefull for high
traffic
web sites.
So, IMHO, a real merge isn't possible because goals are really different.
Fab
> dave
>
>
> -----Original Message-----
> From: Fabien MARTY [mailto:fabien.marty@free.fr]
> Sent: Tuesday, November 05, 2002 2:00 PM
> To: Jon Wood; dviner@yahoo-inc.com
> Cc: pear-dev@lists.php.net
> Subject: Re: [PEAR-DEV] Cache_Lite 1.0 ?
>
>
> Le mar 05/11/2002 à 22:40, Jon Wood a écrit :
> > You choose what features you need... if you just need basic file
> system
> > based caching, then you go for cache_lite - if you need more
> features,
> then
> > use cache.
>
> I will add that Cache_Lite is 4 times faster than Cache (bench on my
> computer only). And it's completly protected against cache corruption
> (writing and reading at the same time). So it's designed for high
> traffic site (tested successfully with two web sites of 600000 pages a
> day). On the other hand, it's less flexible than Cache (Cache_Lite use
> only file container) and it's true that there is less features.
>
> So you have a choice.
>
> > Although it's a valid comment - could we merge the two so that
> they're
> > backend drivers for one cache implementation, or are the APIs
> signifigantly
> > different... I havn't used them before.
>
> The API is not really different. But a merge is not possible because
> Cache_Lite use ONLY a file container (for speed). Moreover, PEAR.php
> is
> included dynamically (include_once) only when an error is detected. So
> in the most of cases, PEAR.php isn't included (which allow a big jump
> of
> perfs).
>
> So there is a choice. BTW it has been already discussed on this list
> :-)
>
> Fab
>
>
>
>
>