Bug #89056

Slow array function used in loop

Added by Andreas Fernandez 3 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-09-02
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Currently in a lot of places array functions like merge and replace are used in loops which is quite CPU hungry.

See https://github.com/kalessil/phpinspectionsea/blob/master/docs/performance.md#slow-array-function-used-in-loop


Related issues

Related to TYPO3 Core - Task #89276: Revert 'Slow array function used in loop' Resolved 2019-09-25

Associated revisions

Revision e531ddce (diff)
Added by Andreas Fernandez 3 months ago

[TASK] Avoid slow array functions in loops

This patch moves some array functions used in loops (array_merge,
array_replace) out of their calling loop for performance reasons, where
applicable.

This this achieved by calling the functions via array unpacking ("splat
operator").

See for further reading:
https://github.com/kalessil/phpinspectionsea/blob/master/docs/performance.md#slow-array-function-used-in-loop

Resolves: #89056
Releases: master
Change-Id: Ia21b1909f77879918b84c6fa702f07a41149e83f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59083
Tested-by: TYPO3com <>
Tested-by: Frank Nägler <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Frank Nägler <>
Reviewed-by: Anja Leichsenring <>

History

#1 Updated by Gerrit Code Review 3 months ago

  • Status changed from In Progress to Under Review

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

#2 Updated by Gerrit Code Review 3 months ago

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

#3 Updated by Andreas Fernandez 3 months ago

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

#4 Updated by Anja Leichsenring 3 months ago

  • Related to Task #89276: Revert 'Slow array function used in loop' added

Also available in: Atom PDF