[!!!][TASK] Refactor property access in compiled fluid templates 48/39148/8
authorChristian Müller <christian@kitsunet.de>
Fri, 1 May 2015 10:21:19 +0000 (12:21 +0200)
committerNicole Cordes <typo3@cordes.co>
Sun, 3 May 2015 09:09:42 +0000 (11:09 +0200)
commit3bebd954624564ea64ee5e49bbbadf0a407947eb
treef812bdf19e444e0333992b56b82db708674ddebd
parent94330de66f089be326297cea6ec99b4d6365b36e
[!!!][TASK] Refactor property access in compiled fluid templates

Using ObjectAccess::getPropertyInternal is pretty expensive if called
repeatedly as can happen in bigger templates. On rendering the compiled
template for the first time we can generate the used getter and/or array
access information and write that into the compiled template.
Subsequent usages of the compiled template will then have much faster
access to nested variables.

This change is breaking if you push mixed data to the template. For
example an array that contains both arrays and object and access those
with the same property path access. In this case the cached accessors
might be wrong.

Resolves: #66758
Releases: master
Change-Id: Icb368938e67725d3a30a2545a30b40f045199405
Reviewed-on: http://review.typo3.org/39148
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
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>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/core/Documentation/Changelog/master/Breaking-66758-FluidRefactorPropertyAccess.rst [new file with mode: 0644]
typo3/sysext/fluid/Classes/Core/Compiler/AbstractCompiledTemplate.php
typo3/sysext/fluid/Classes/Core/Compiler/TemplateCompiler.php
typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/ObjectAccessorNode.php