Jira issue originally created by user jpaardekooper:
Our application has some serious problems with the performance of persisting data of large data sets. I'll try to explain it as clear as possible with a basic scenario.
Say our application has users that can be linked to one or more companies. A company is fairly large object with alot of OneToMany relations, for example Cars, Houses, Pets etc. Alot of stuff. Most of these objects have their own repository as well.
We have a UI that lets us create a Car and link it to a company. The performance of this is fine when the current user isn't link to alot of Companies that don't have alot of Cars, Houses, Pets etc. However, as soon as the data set becomes larger (say, 50 companies each with 25 Cars, Houses and Pets), it takes about 30 seconds to insert one simple Car.
The basic object model:
class Company {
/****
* @var string
*/
protected $name;
/****
* @var \Doctrine\Common\Collections\ArrayCollection<Car>
* @ORM\OneToMany(mappedBy="company")
* @Flow\Lazy
*/
protected $cars;
// alot more fields
}
class Car {
/****
* @var string
*/
$licensePlate
/****
* @var Company
* @ORM\ManyToOne(inversedBy="cars")
*/
protected $company;
// some more fields
}
I've tracked the performance down to the TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/PersistenceManager.php file, where the Car object is triggered for validation (line 82). It then goes into the validateObject method and validates the Car. But when it validates the Car, it will also validate the Company and the Company will also validate all the Houses, Pets, etc.
A temporary solution is to add the @flow\IgnoreValidation annotation to the $company property in Car. I don't think that's a very flexible and nice solution and wonder if it could be done better.
Jira-URL: https://jira.neos.io/browse/FLOW-17