Issue Task Closed

#102877Remove todo for intExplode function in GeneralUtility

Torben Hansen 01/20/24, 14:11 updated 01/30/24, 08:28

Description

A todo added for the GeneralUtility::intExplode() function suggests refactor the function by using array_filter and array_walk. This refactoring may be good in terms of readability, but has negative impact on the performance of the function when used with large strings containing many comma separated values.

Example php script for a performance comparison: https://gist.github.com/derhansen/e0751d896ba0d48917dccd44bd4e4d1e

Result in seconds for 1.000.000 comma separated numbers in a string:

Old: 0.16220808029175
New: 0.68774104118347

I would therefore prefer to keep the function as it is and remove the todo.

Reviews 1