[TYPO3-core] Another patch request for t3lib_htmlmail

Dmitry Dulepov dima at spamcop.net
Thu Jan 26 18:49:42 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Karsten Dambekalns wrote:
> Err, str_replace slower than preg_replace? Any hard numbers to back that up?

Not very hard but for 100,000 iterations:
E:\>c:\php\php -q 1.php
0.7458188533783-0.59488701820374
0.74121308326721-0.59862399101257
0.72867512702942-0.58960485458374
0.73737502098083-0.59518694877625
0.73679399490356-0.58968591690063

First number is cumulative time for str_replace, second is for preg_replace. Of
course this is not significant difference for one iteration but how many calls
are in the system?

Also I found one page that says it depends on various conditions:
http://www.php-scripts.com/php_diary/011303.php3

>>or other string functions. 

preg_match() is a little bit faster than strstr() but the difference is minimal.

Dmitry.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFD2Qu2RVcYnKJ8N6kRAvHYAJ9cLmm1ZOHVfyuBiuMYfznC9pj2WwCdFRmd
UhBi3KVAjQ8Xzwh8Ha85JFo=
=h6ID
-----END PGP SIGNATURE-----



More information about the TYPO3-team-core mailing list