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 almost 9 years ago. Updated about 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 #1

Updated by Philipp Gampe almost 9 years ago

  • Parent task set to #63692
Actions #2

Updated by Gerrit Code Review almost 9 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

Actions #3

Updated by Gerrit Code Review almost 9 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

Actions #4

Updated by Gerrit Code Review almost 9 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

Actions #5

Updated by Wouter Wolters almost 9 years ago

  • Status changed from Under Review to Resolved
Actions #6

Updated by Benni Mack about 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF