Re: turning strlen() into an opcode
| From: | Jon Parise | Date: | Fri, 08 Nov 2002 23:52:40 +0000 |
| Subject: | Re: turning strlen() into an opcode | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-90679@lists.php.net to get a copy of this message | ||
On Fri, Nov 08, 2002 at 04:17:43PM -0500, Andrei Zmievski wrote:
> I've made a small patch that turns strlen() into a statement executed by
> the engine instead of a function. The reasoning is that something that
> integral should probably be in the engine. I haven't done hard
> benchmarking but it seems to improve performance of that particular
> piece of code by about 25%. Feedback is welcome.
I'd be more interested in seeing a more generic len() function (a la
Python) that would return the length of the variable passed to it (the
number of characters in a string, then number of elements in an
array). Actually, I suppose extending count() to handle strings would
be mostly equivalent.
--
Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)