Project

General

Profile

Actions

Bug #63745

closed

Bug #63692: Memory consumption while bulk inserting

date/datetime checks in DataHandler->checkValue_input lead to high memory use while bulk inserting

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

Status:
Closed
Priority:
Should 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:
easy
Is Regression:
No
Sprint Focus:

Description

$dateTimeFormats are fetched for every input field (altough not needed) and the expensive GeneralUtility::inList-check for date,datetime-fields is executed twice:

public function checkValueForInput($res, $value, $tcaFieldConf, $table, $id, $realPid, $field = '') {
    // Handle native date/time fields
    $dateTimeFormats = $GLOBALS['TYPO3_DB']->getDateTimeFormats($table);
    if (isset($tcaFieldConf['dbType']) && GeneralUtility::inList('date,datetime', $tcaFieldConf['dbType'])) {
        // Convert the date/time into a timestamp for the sake of the checks
        $emptyValue = $dateTimeFormats[$tcaFieldConf['dbType']]['empty'];
        $format = $dateTimeFormats[$tcaFieldConf['dbType']]['format'];
        // At this point in the processing, the timestamps are still based on UTC
        $timeZone = new \DateTimeZone('UTC');
        $dateTime = \DateTime::createFromFormat('!' . $format, $value, $timeZone);
        $value = $value === $emptyValue ? 0 : $dateTime->getTimestamp();
    }

    [...]

    // Handle native date/time fields
    if (isset($tcaFieldConf['dbType']) && GeneralUtility::inList('date,datetime', $tcaFieldConf['dbType'])) {
        // Convert the timestamp back to a date/time
        $emptyValue = $dateTimeFormats[$tcaFieldConf['dbType']]['empty'];
        $format = $dateTimeFormats[$tcaFieldConf['dbType']]['format'];
        $res['value'] = $res['value'] ? date($format, $res['value']) : $emptyValue;
    }
Actions #1

Updated by Wouter Wolters over 9 years ago

  • Parent task set to #63692
Actions #2

Updated by Gerrit Code Review over 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/35253

Actions #3

Updated by Gerrit Code Review over 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/35253

Actions #4

Updated by Gerrit Code Review over 9 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/35253

Actions #5

Updated by Gerrit Code Review over 9 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/35253

Actions #6

Updated by Gerrit Code Review over 9 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/35253

Actions #7

Updated by Gerrit Code Review over 9 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/35253

Actions #8

Updated by Gerrit Code Review over 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/35320

Actions #9

Updated by Stephan Großberndt over 9 years ago

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

Updated by Gerrit Code Review over 9 years ago

  • Status changed from Resolved to Under Review

Patch set 2 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/35320

Actions #11

Updated by Gerrit Code Review over 9 years ago

Patch set 3 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/35320

Actions #12

Updated by Stephan Großberndt over 9 years ago

  • Status changed from Under Review to Resolved
Actions #13

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF