[BUGFIX] Reduce expensive calls in AbstractMenuContentObject 76/50776/5
authorClaus Due <claus@namelesscoder.net>
Mon, 14 Nov 2016 14:21:43 +0000 (15:21 +0100)
committerJan Helke <typo3@helke.de>
Sat, 3 Dec 2016 08:46:38 +0000 (09:46 +0100)
commit0558c7daaa16b999c9b6fc4711814c8cfa332a5b
tree9f587dc8c757335822229ec81937ffa04f0693f2
parent53a94aa4bfe43645df998a785c427bb9527cc671
[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/50776
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php