Zend Framework

Function and Class frontends always call test() before load()

Details

  • Type: Performance Improvement Performance Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7.2
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Cache
  • Labels:
    None

Description

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

Activity

Hide
Fabien MARTY added a comment -

change Assignee because I'm inactive now

Show
Fabien MARTY added a comment - change Assignee because I'm inactive now
Hide
Satoru Yoshida added a comment -

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().

Show
Satoru Yoshida added a comment - 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().
Hide
Marc Bennewitz (private) added a comment -

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.

Show
Marc Bennewitz (private) added a comment - 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.
Hide
Marc Bennewitz (private) added a comment -

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

Show
Marc Bennewitz (private) added a comment - fixed in r20378 (trunk) & r20379 (1.10 branch)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: