[PATCH] String function optimizations
| From: | Ilia A. | Date: | Fri, 04 Oct 2002 02:21:26 +0000 |
| Subject: | [PATCH] String function optimizations | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-88995@lists.php.net to get a copy of this message | ||
After doing a number of tests on PHP's various string functions, I've came up
with a patch that significantly improves the performance on those functions.
The patch optimizes:
php_addslashes() - internal PHP function used to add slashes to a string
(15-20% speed increase)
php_memnstr() - internal PHP function used to find a multibyte string inside
another string. 35-40% speed increase when string is found, 90-100%
speed increase when the string is not found.
substr_count() - PHP function used to determine the number of times a string
occurs within another string. 20-25% speed increase + additional speed
gains from usage of optimized php_memnstr() function.
Please let me know if there are any objections, better suggestions, bug
reports (pertaining to this patch) that would need to be resolved before this
bug goes into the CVS.
Ilia
Attachment: [text/x-diff] string.patch
Attachment: [text/x-diff] string.patch