Re: Namespaces in PHP 6 - ++$take

From: Date: Fri, 10 Nov 2006 18:13:52 +0000
Subject: Re: Namespaces in PHP 6 - ++$take
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-26479@lists.php.net to get a copy of this message
On 10-Nov-06, at 12:54 PM, Sebastian Bergmann wrote:
Ilia Alshanetsky wrote:
If anything it'll make code complex and intertwined, introduce serious scope issue most people have not had to consider up until now and so on. It will without a doubt increase language complexity as well, which generally translates to a loss in performance.
Am I right to assume that both scoping and performance issues only come up if we were to implement an import() mechanism? If so, do we really need import? If not, then namespace foo {
     class bar
     {
     }
} would be "mangled" at compile-time into foo\bar and should not impose any performance penalty or scoping issues.
As your key size increases the slower the key hash generation process becomes, if you look at the PHP's hash key generation code you'll see that it works best for 8 or less chars, anything longer and the performance starts to drop. Add to this case-sensitivity issues and you have an additional draw on your speed. Obviously, by doing things at compile time you reduce overhead, so it is a good idea, but it will not eliminate the performance penalties, it'll probable halve them however. Ilia Alshanetsky

« previous php.internals (#26479) next »