[TYPO3-core] RFC: #8515: Speed up tslib_cObj->getTreeList by caching its results

Ingo Renner ingo at typo3.org
Mon May 26 13:34:09 CEST 2008


Dmitry Dulepov [typo3] wrote:

Hi Dmitry,

> Oliver Klee wrote:
>> - Do we really need to store the cache in the DB or would a cache in a 
>> static variable suffice?
> 
> My question as well. It may be useful for USER_INT extensions to have 
> such information in cache. But for USER it is mostly irrelevant. In any 
> case storing in database does not hurt, so I am neutral on this.

Actually _all_ extensions will benefit from this patch. The gain will be 
higher if the extension needs to look through more pages. F.e. setting 
the starting point to the site's root and setting recursion to infinite.

USER plugins of course benefit from the cache only the first time they 
get rendered, USER_INT plugins instead do benefit from it every time 
they get called.

For the use of DB: see my reply to Oliver. It pretty much wouldn't speed 
up anything if it would not be stored in the DB.

>> Some issue concerning coding style (as decided upon in the CGL session):
> 
> In addition I remember old CGL said that files in tslib/ has tslib_ 
> prefix. The added class is not strictly in tslib/ (it is one directory 
> below) but it may be more consistent to call it  
> tslib_treelistCacheUpdate instead of tx_cms_treelistCacheUpdate. I do 
> not insist. Just thoughts. I am all in favor of tx_ everywhere but 
> mixing tx_cms_ and tslib_ does not look good.

The issue here is that the class is part of the CMS (system) extension 
and thus needs to be prefixed with tx_cms_. Otherwise you'd get 
complaints about naming convention violations in the EM (this is tested ;-)

OTOH the class does not directly belong to tslib but to the CMS 
extension in general

> Patch is big I am looking to the code. Could not find any issues by 
> looking. It should be a big advantage to have it in core!

most things just clean up the code. There're only two things n 
tslib_cObj: at the beginning of getTreeList the cache is checked and at 
the end it is written if we had a cache miss.

The other thing is of course the hook class that "maintains" the cache.


Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2


More information about the TYPO3-team-core mailing list