Bug #63674
closedBug #63692: Memory consumption while bulk inserting
High memory consumption in BackendUtility->explodeSoftRefParserList while bulk inserting
0%
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
Updated by Gerrit Code Review almost 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35187
Updated by Gerrit Code Review almost 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35187
Updated by Gerrit Code Review almost 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35775
Updated by Wouter Wolters almost 10 years ago
- Status changed from Under Review to Resolved