Re: turning strlen() into an opcode

From: Date: Fri, 08 Nov 2002 22:24:57 +0000
Subject: Re: turning strlen() into an opcode
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-90674@lists.php.net to get a copy of this message
At 05:18 PM 11/8/2002 -0500, Andrei Zmievski wrote:
On Sat, 09 Nov 2002, Andi Gutmans wrote: I am very much against anything like this. Improving strlen()'s performance only will have a negligible performance impact on a real world script. With the same kind of argument you could probably find 10-20 functions which would be faster if you'd make opcodes for them. That's not really what you'd want to do. Also, the patch isn't quite the same functionality wise because strlen in your patch is a reserved word. This isn't my main problem though as it could be solved. Just out of curiousity, what are the problems with making it a reserved word and how could it be solved?
What if you wanted to have a constant STRLEN? It would break. It could be solved by doing strcmp()'s during the compilation of a function and checking if the function name is strlen().
If you want to really help improve performance of real-world scripts then try and find a way to improve performance of *all* function calls, i.e., of the extension API; and not by moving functions from the extension API into the core. No big deal. This just came up at the PHP conference in Germany during a chat with George and Thies.
I could have guessed Thies had a hand in it :) Andi

« previous php.dev (#90674) next »