Actions
Bug #63670
closedBug #63692: Memory consumption while bulk inserting
High memory consumption in DataHandler->checkValue_input while bulk inserting
Start date:
2014-12-08
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
In DataHandler->checkValue_input for each input value of each record to insert is executed.
// Process evaluation settings: $evalCodesArray = GeneralUtility::trimExplode(',', $tcaFieldConf['eval'], TRUE);
While this may seem minor introducing a cache here helps:
public function checkValue_input($res, $value, $tcaFieldConf, $PP, $field = '') { static $evalCodesCache = array(); [...] // Process evaluation settings: if ($evalCodesCache[$tcaFieldConf['eval']]) { $evalCodesArray = $evalCodesCache[$tcaFieldConf['eval']]; } else { $evalCodesArray = GeneralUtility::trimExplode(',', $tcaFieldConf['eval'], TRUE); $evalCodesCache[$tcaFieldConf['eval']] = $evalCodesArray; }For bulk inserting of 6500 records:
- 2 calls instead of 44646 to trimExplode from this function
- 0.7 sec faster
- memory_usage of trimExplode down by 17MB
Files
Actions