ezsystems/ezpublish — pull request #378 by patrickallaert (2012-07-31 08:59:56+00:00)
Title: Fixed #019544: Showing/hiding a large number of objects generates fatal error

eZContentCacheManager's API was mostly made to handle one object ID at a time. This prevented optimizing some parts of the code by handling many objects at once.

Full BC is kept and error handling has been put to prevent inconsistent calls like passing a version number and a list of objectc IDs.

Having a subtree made of 6 863 objects with different tree depth, it took:

* previously:
+ To hide:
- 286049680 bytes (peak) of memory (+/- 273Mb)
- 42.89 sec to execute
+ To unhide:
- 286048672 bytes (peak) of memory (+/- 273Mb)
- 43.65 sec to execute
+ To execute: ```$ php bin/php/ezcontentcache.php --clear-subtree```
- 15.02 sec to execute

* with this fix:
+ To hide:
- 34053424 bytes (peak) of memory (+/- 32Mb)
- 40.24 sec to execute
+ To unhide:
- 34054184 bytes (peak) of memory (+/- 32Mb)
- 39.52 sec to execute
+ To execute: ```$ php bin/php/ezcontentcache.php --clear-subtree```
- 9.83 sec to execute

```eZContentObjectTreeNode::clearViewCacheForSubtree()``` has been limited to handle 50 objects at the same time in a previous commit. This fix increases this limit to 200 objects since the culprit of high memory
consumption has been fixed. It requires about **39Mb** of memory (compared to **32Mb**) but makes it possible to hide/unhide the whole subtree in **19.7** seconds rather than about **40** seconds.