ZF-5514: Function and Class frontends always call test() before load()

Issue Type: Performance Improvement Created: 2009-01-10T20:44:44.000+0000 Last Updated: 2010-01-18T06:41:32.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Alex Sirota (iosart) Assignee: Marc Bennewitz (private) (mabe) Tags: - Zend_Cache

Related issues: Attachments: - zend_cache_frontend_function+class.patch


With some backends (like File) this is efficient., as test() is more efficient than load(). On other backends (like memcached), test() and load() are essentially the same (call _memcache->get), which means that for every cache hit there are two roundtrips to memcached. With such backends, the frontend should just call load() and see if it returns anything.

getCapabilities() can be potentially used to communicate backend's preference to the frontend


Posted by Fabien MARTY (fab) on 2009-07-17T11:03:34.000+0000

change Assignee because I'm inactive now

Posted by Satoru Yoshida (satoruyoshida) on 2009-08-22T04:25:12.000+0000

I think it has wide effect over many backends, if we would not call test() before load().

I want to know how much time would be saved by unifieing test() into load().

Posted by Marc Bennewitz (private) (mabe) on 2010-01-15T14:25:03.000+0000

Added a patch.

This uses only load to get cached data and to detect uncached data. (load have to return false if cache doesn't hit by all backends)

Furthermore this patch check first if the cached result is an valid array for function/class frontend.

Posted by Marc Bennewitz (private) (mabe) on 2010-01-18T06:41:32.000+0000

fixed in r20378 (trunk) & r20379 (1.10 branch)

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.