Project

General

Profile

Actions

Bug #63670

closed

Bug #63692: Memory consumption while bulk inserting

High memory consumption in DataHandler->checkValue_input while bulk inserting

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

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

eval.txt (7.74 KB) eval.txt Ocurrences of reading 'eval' Stephan Großberndt, 2015-01-05 16:39

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #103125: Stop runtime caching GU::trimExplode() in DHResolved2024-02-15

Actions
Actions

Also available in: Atom PDF