[TYPO3-core] Extbase validation, lazy loading and performance
Nicolas de Haen
typo3 at ndh-websolutions.de
Mon Nov 25 12:47:52 CET 2013
To continue this thread:
I pushed two patches [1] to gerrit which should avoid the recursive
validation and the redundant calls. At least in my use case it reduced
the number of queries for a complex model from 2534 to 900.
The changed behaviour of the new Extbase validation introduced with 6.2
is described in the comment for the method
ValidatorResolver->buildBaseValidatorConjunction (which is the same as
in Flow)
"The base validation rules are those which were declared directly in a
class (typically a model) through some validate annotations on properties.
If a property holds a class for which a base validator exists, that
property will be checked as well, regardless of a validate annotation"
This means that even lazy annotated class properties will be loaded from
persistence if a validator is resolved for them (or a subproperty). I
tested this behaviour with Flow and Extbase and could confirm it.
This happens also if a type validator is found - for example any
property of type \DateTime will add a validator and cause a validation
of the object regardless of a @ignorevalidation annotation in the
calling action.
This might be performance relevant in Core extensions based on extbase.
Kind regards,
Nico
[1]
https://review.typo3.org/#/c/25549/
https://review.typo3.org/#/c/25252/
--
Nico de Haen
ndh websolutions
Webprogrammierung, OpenSource, Typo3
http://www.ndh-websolutions.de
More information about the TYPO3-team-core
mailing list