Bug #63735

High memory consumption in DataHandler->checkValue_SW while bulk inserting

Added by Stephan Großberndt over 4 years ago. Updated 10 months ago.

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

100%

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 / endtime Closed 2017-10-13

Associated revisions

Revision e1695035 (diff)
Added by Stephan Großberndt about 4 years ago

[TASK] Deprecate public DataHandler->checkValue_*-methods

Instead of passing all parameters from DataHandler->checkValue_SW to
the checkValue_*-methods in an array $PP, pass only those actually
needed by each function.

In order to stay compatible keep the public checkValue_*-methods
(now unused in core and deprecated) and introduce new protected
methods checkValueFor* instead, called from checkValue_SW.

Resolves: #63735
Releases: master
Change-Id: I463c35e5361310f401ca5e0cc9833e6cbebfff9f
Reviewed-on: http://review.typo3.org/35238
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Frank Nägler <>
Tested-by: Frank Nägler <>

History

#1 Updated by Gerrit Code Review over 4 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 over 4 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 over 4 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 over 4 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 over 4 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 over 4 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 over 4 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 4 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 4 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 4 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 4 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 4 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 about 4 years ago

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

#14 Updated by Oliver Hader about 1 year ago

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

#15 Updated by Benni Mack 10 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF