Issue Bug Closed

#23402[Caching framework] Remove tagIndex from memcached and apc backend

Christian Kuhn 08/19/10, 01:25 updated 10/02/18, 12:22

Description

The following patch will be committed in 72 hours if nobody objects:

Type: Performance improvement

Branches: trunk, 4.4, 4.3

BT: http://bugs.typo3.org/view.php?id=15497
FLOW3 issue: http://forge.typo3.org/issues/8918 (committed)

Problem:
The memcached and apc backend implementations currenty store this key-value “structure” to map our identifier-data-keys relation: * identifier -> data * identifier -> keys * key -> identifiers * tagIndex -> All known tags

The tagIndex doesn’t have any benefit at all, it just leads to more set() and get() calls.

Solution:
Completly remove tagIndex to save some operations which speeds up the backends, unit tests still show green bar.

Numbers:
Performance tests of memcached backend show that the backend speeds up between ~10 to 100% by removing the tagIndex. As an example, attached images show a test which set()’s a raising number of cache entries with a single attached tag to the backend. More numbers can be generated with ext:enetcacheanalytics (forge) in v4.

Notes:
- Memcache is a simple key-value store and not designed to store structures of multiple related entries. Our implementation is a misuse, which leads to corrupt caches if memcache evicts entries from cache (because it needs space for new elements), or if single servers fail in a multi server environment.
- APC backend implementation is pretty much identical to the memcache implementation, it’s just affected by this change as well, but is not benchmarked on it’s own here.

(issue imported from #M15497)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.