[TYPO3-core] RFC #11410: Speed up BEgetRootLine by reusing parts of the rootline from the cache
Oliver Hader
oliver at typo3.org
Fri Jun 26 16:17:43 CEST 2009
Hi Fabrizio,
Fabrizio Branca schrieb:
> This is an SVN patch request.
>
> Type: New feature/Code cleanup?
>
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=11410
>
> Branches:
> trunk
>
> Problem:
> Now t3lib_BEfunc::BEgetRootLine() caches whole rootlines without reusing
> the cache for subparts of other rootlines. Especially in the backend
> (e.g. on heavy operation that call BEgetRootLine on multiple pages) this
> means that the same pages will be queried over and over again appearing
> in different rootlines.
>
> Solution:
> By restructuring the cache and refactroring the method is possible to
> store single pages into the cache and reuse those cache entries to build
> new rootlines.
>
> After appling my patch I amount of select statements was reduced to 50%
> and profiling shows that the BEgetRootLine was 200% faster (when adding
> the whole pagetree wo the crawler queue)
>
> BEgetRootLine behaves like it does before and the restructured cache in
> $GLOBALS['T3_VAR']['BEgetRootLine_cache'] is not used in other places in
> the core.
Great feature! In the context of processing multiple sites at once (e.g.
like done by the crawler as you already mentioned) this really increases
performance. In regular context I experienced many calls that were
served by the cache on creating a new content element for example.
However, I changed some things (see the attached patch):
* added a break when no page could be found (otherwise the while loop
would run until the loop check is zero)
* removed the SQL debug check (this is served by enabling "sqlDebug" in
the Install Tool)
* fixed some spacing/formatting issues
Besides that: +1 on reading and testing
olly
--
Oliver Hader
TYPO3 Release Manager 4.3
More information about the TYPO3-team-core
mailing list