[TYPO3-mvc] How to speed up the creation of 100.000+ objects in an extbase extension?

Roland most.wanted at gmx.at
Wed Dec 5 17:32:36 CET 2012


hi everybody,

i have to import 100.000+ database records from an external oracle 
database. these records should be transformed into objects of a extbase 
extension.

at the moment this takes a lot of time. 60+ minutes an still waiting...

is there something like a best practice to make this work faster?

this is some of my code:

--- quote ---

foreach ($recordSet as $record) {
   $newUser = 
$this->objectManager->create('Tx_MyExtension_Domain_Model_User');
   $newUser->setName($record['name']);
   $newUser->setName($record['email']);
   $newUser->setName($record['fax']);
   ...
   $newUser->setName($record['phone']);
   $newUser->setName($record['city']);
   $newUser->setName($record['zip']);
   $this->userRepository->add($newUser);
}

--- /quote ---

how can i improve this? what about a persistAll() or should a unset() 
help somehow?

kind regards

roland


More information about the TYPO3-project-typo3v4mvc mailing list