Details
-
Type:
Performance Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9.3
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Cache
-
Labels:None
Description
In the Zend_Cache_Backend_Memcached->save method it tries memcache->add and if it fails does a memcache->set.
The comment just above this code says that set() seems slower.
My tests indicate that add() and set() is almost identical in speed.
Also, if done in this way we assume that the cache-keys doesn't already exist most of the time (that add() doesn't fail).
If add() fails, the saving of a cache will take double time.
I propose to just call memcache->set(), and not do add() at all. This will give consistent speed on saving the cache.
Issue Links
| This issue is related to: | ||||
| ZF-5702 | Memcached backend performs set() calls unecessarily |
|
|
|
Yes, on replacing items all memcache requests are send twice.
But in inserting new one the requests are send once but memcache isn't really faster because memcache have to check if the item exits anyway.
Therefor a simple set is enough.
I'm planing to integrate some new functionality (like add, replace, multiple interface etc.) but there few toto's:
(http://framework.zend.com/wiki/display/ZFPROP/Zend_Cache+refactoring+-+Marc+Bennewitz)