[TYPO3-core] RFC #10511: simplify and speed up t3lib_div::trimExplode()
Ingo Renner
ingo at typo3.org
Sat Feb 21 00:33:26 CET 2009
Hi all,
This is a SVN patch request
Type: tweak
Branches: trunk
BT reference: http://bugs.typo3.org/view.php?id=10511
Problem:
currently trimExplode() uses loops to process elements of arrays created
by an explode before.
Solution:
Using native php functions that achieve the same goal is simpler,
shorter, and most importantly faster.
To make sure the behavior stays as it is right now I created four unit
tests.
Notes:
using the benchmark I usually get a speed up of 30-50%, I even had 70%
once. After finding calls to trimExplode in roughly 380 places through
out the core I guess that should do something...
all the best
Ingo
--
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simpler_faster_trimExplode.diff
Type: text/x-diff
Size: 4762 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090221/3c2e6ce7/attachment-0001.diff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090221/3c2e6ce7/attachment-0001.htm
More information about the TYPO3-team-core
mailing list