Bug #63735

High memory consumption in DataHandler->checkValue_SW while bulk inserting

Added by Stephan Großberndt almost 7 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Performance
Target version:
Start date:
2014-12-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

DataHandler->checkValue_SW is a switch function calling the public checkValue_*-functions [checkValue_text, checkValue_input, checkValue_check, checkValue_radio, checkValue_group_select, checkValue_inline, checkValue_flex].

Instead of just passing all parameters needed for those functions some of them are put into an array $PP and passed to the checkValue_*-functions

public function checkValue_SW($res, $value, $tcaFieldConf, $table, $id, $curValue, $status, $realPid, $recFID, $field, $uploadedFiles, $tscPID, array $additionalData = NULL) {

    [...]

    $PP = array($table, $id, $curValue, $status, $realPid, $recFID, $tscPID);
    switch ($tcaFieldConf['type']) {
        case 'text':
            $res = $this->checkValue_text($res, $value, $tcaFieldConf, $PP, $field);
            break;

where in some cases these parameters from $PP are not needed at all (checkValue_text, checkValue_radio) and in others they are separated again by a list()-call and only some of them are used.

public function checkValue_text($res, $value, $tcaFieldConf, $PP, $field = '') {
    $evalCodesArray = GeneralUtility::trimExplode(',', $tcaFieldConf['eval'], TRUE);
    $res = $this->checkValue_text_Eval($value, $evalCodesArray, $tcaFieldConf['is_in']);
    return $res;
}

public function checkValue_input($res, $value, $tcaFieldConf, $PP, $field = '') {
    list($table, $id, $curValue, $status, $realPid, $recFID) = $PP;

By putting them in an array they cannot be passed as reference. The function checkValue_SW is called for each field of each record to add or update, leading to lots of memory being used.

The checkValue_*-functions should not get their parameters passed as an array and should take only the parameters necessary.

If for TYPO3 6.2 the signature change is is not possible (they are public), I propose to add new functions checkValue_*-functions with the changed signatures, call those from checkValue_SW and also from the old checkValue_*-functions.


Related issues

Related to TYPO3 Core - Bug #82756: Can't remove access starttime / endtimeClosed2017-10-13

Actions

Also available in: Atom PDF