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
#1

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

#2

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

#3

Updated by Gerrit Code Review almost 7 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#4

Updated by Gerrit Code Review almost 7 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#5

Updated by Gerrit Code Review almost 7 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#6

Updated by Gerrit Code Review almost 7 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#7

Updated by Gerrit Code Review almost 7 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#8

Updated by Gerrit Code Review over 6 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#9

Updated by Gerrit Code Review over 6 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#10

Updated by Gerrit Code Review over 6 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#11

Updated by Gerrit Code Review over 6 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#12

Updated by Gerrit Code Review over 6 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35238

#13

Updated by Stephan Großberndt over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#14

Updated by Oliver Hader over 3 years ago

  • Related to Bug #82756: Can't remove access starttime / endtime added
#15

Updated by Benni Mack almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF