[BUGFIX] Reduce expensive calls in AbstractMenuContentObject 52/50652/4
authorClaus Due <claus@namelesscoder.net>
Mon, 14 Nov 2016 14:21:43 +0000 (15:21 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 2 Dec 2016 16:12:08 +0000 (17:12 +0100)
commitc148fd882c2e1a7ef2c9a10bf90437b2155d2432
tree3e3da429ad1672e642cb4dd628a356b084a3a6ea
parentcf77fa328e71548ec95aaf8955c0d0c2d28e9d87
[BUGFIX] Reduce expensive calls in AbstractMenuContentObject

This patch reduces the number of SQL queries and PHP calls
which get performed when rendering menus. The patch has
two parts:

* Runtime cache is used to remember a generated link and
  is given a cache identifier which includes a hash of all
  parameters which may affect the link.
* Runtime cache is used to remember the decision if a page
  is a submenu.

The item rendering function is called every time the same page
is rendered in any menu in the same request, and the decision
function to check if page is a sub-menu is called at least three
times with the same UID when generating a menu. Both of these
implements together reduce the necessary re-calling of methods
which generate the same output given the same arguments.

Change-Id: Idd6225081e8fb3f8160270af3d865b48208b756e
Releases: master, 7.6
Resolves: #78693
Reviewed-on: https://review.typo3.org/50652
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Daniel Alder <dalder@snowflake.ch>
Tested-by: Daniel Alder <dalder@snowflake.ch>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php