Project

General

Profile

Actions

Task #55564

closed

Improve GeneralUtility::revExplode performance

Added by Andreas Wolf almost 11 years ago. Updated about 7 years ago.

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

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

GeneralUtility::revExplode always inverses the string and does multiple array operations, which are quite expensive. To speed it up, it can be split into several parts:

  1. a regular explode() for "0" parts [i.e. unlimited]
  2. just the string for 1 part
  3. manually split for 2 parts (saves the costly array operations)
  4. the old method for > 2 parts

A quick benchmark showed that 3 only takes half the time of 4 for the case of 2 parts (which currently is the only case in which this method is used in the core).

As this method is used extensively by e.g. GeneralUtility::dirname, this should give a performance increase of 1-2 ms in the backend.


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #55838: revExplode returns invalid values if no delimiter in stringClosedAlexander Stehlik2014-02-10

Actions
Related to TYPO3 Core - Bug #56405: GeneralUtility::revExplode returns unexpected result to getSingleField_typeFlex_draw()Closed2014-02-28

Actions
Related to TYPO3 Core - Bug #55822: "else if" in GeneralUtility breaks the buildClosedOliver Klee2014-02-09

Actions
Actions

Also available in: Atom PDF