Actions
Bug #63674
closedBug #63692: Memory consumption while bulk inserting
High memory consumption in BackendUtility->explodeSoftRefParserList while bulk inserting
Start date:
2014-12-08
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:
Description
Due to improper checking for an empty value BackendUtility->explodeSoftRefParserList multiple trimExplodes per record are executed
static public function explodeSoftRefParserList($parserList) { // Looking for global parsers: if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'])) { $parserList = implode(',', array_keys($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'])) . ',' . $parserList; } // Return immediately if list is blank: if (!strlen($parserList)) { return FALSE; }
Using only is_array when looking for global parsers and appending ',' . $parserList leads to $parserList = ',' which does not result in an early return but a full parse.
static public function explodeSoftRefParserList($parserList) { // Looking for global parsers: if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL']) && count($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL']) > 0) { $parserList = implode(',', array_keys($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'])) . ',' . $parserList; } // Return immediately if list is blank: if (!strlen($parserList)) { return FALSE; }
For bulk inserting of 6500 records:
- 1 sec faster
- memory_usage of explodeSoftRefParserList down by 4.5MB
Actions