Project

General

Profile

Actions

Bug #63674

closed

Bug #63692: Memory consumption while bulk inserting

High memory consumption in BackendUtility->explodeSoftRefParserList while bulk inserting

Added by Stephan Großberndt over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
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

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #64109: Deprecate softRefParser_GLClosed2015-01-04

Actions
Actions

Also available in: Atom PDF