Project

General

Profile

Actions

Bug #63675

closed

Bug #63692: Memory consumption while bulk inserting

High memory consumption for softRefs in ReferenceIndex->getRelations  while bulk inserting

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

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

80%

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

Description

For every field of every record ReferenceIndex->getRelations executes:

                // Soft References:
                if (strlen($value) && ($softRefs = BackendUtility::explodeSoftRefParserList($conf['softref']))) {

The return value of explodeSoftRefParserList is not dependent on the record itself, but only table and field. Introducing a cache for softRefs

public function getRelations($table, $row, $onlyField = '') {
    static $softRef_cache = array();

    [...]

                // Soft References:
                if (isset($softRef_cache[$table . 'f' . $field])) {
                    $softRefs = $softRef_cache[$table . 'f' . $field];
                } else {
                    $softRefs = BackendUtility::explodeSoftRefParserList($conf['softref']);
                    $softRef_cache[$table . 'f' . $field] = $softRefs;
                }
                if (strlen($value) && $softRefs) {

reduces when inserting 6500 records:

  • 8 instead of 51,024 calls to explodeSoftRefParserList
  • 0.52 seconds faster
  • 4kb used instead of 2,5MB
Actions

Also available in: Atom PDF