Re: Algorithm Optimizations - string search
| From: | Michal Dziemianko | Date: | Tue, 10 Jun 2008 09:04:15 +0000 |
| Subject: | Re: Algorithm Optimizations - string search | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-38131@lists.php.net to get a copy of this message | ||
On 2008-06-09, at 14:43, Antony Dovgal wrote:
On 09.06.2008 15:39, Michal Dziemianko wrote:Hi Antony, Will correct it in a minute! and will be more careful:) Cheers MichalHello, Here: http://212.85.117.53/DIFF.txt is small patch that will speed up following functions: strpos, stripos, strrpos strripos, and probably some others (all that use zend_memnstr/php_memnstr function)The code below is definitely wrong. The pointers (haystack_dup & needle_dup) that were freed in the previous version are not freed anymore, but I can see that they are still allocated, so you have a memleak there.