Re: Algorithm Optimizations - string search

From: Date: Mon, 09 Jun 2008 13:26:44 +0000
Subject: Re: Algorithm Optimizations - string search
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-38115@lists.php.net to get a copy of this message
Hi Michal, Everything looks fine here and it applies cleanly, do you think you could make a patch against HEAD with this as well? I suspect it will be different due to Unicode. Scott Michal Dziemianko wrote:
Hello, 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 speedup of zend_memnstr is about 8% on average (about 30% in case of artificial strings). Functions strrpos and strripos are about 25% faster on average. The only drawback - it needs some additional space (size of the needle). All functions pass all the tests. If it looks fine than I will apply for cvs account. Cheers, Michal


« previous php.internals (#38115) next »