Re: Simple Namespace Proposal
| From: | Rasmus Lerdorf | Date: | Sat, 07 Jul 2007 16:30:32 +0000 |
| Subject: | Re: Simple Namespace Proposal | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-30598@lists.php.net to get a copy of this message | ||
Stefan Priebsch wrote:
> Hi Dmitry,
>
> Allowing only one namespace per file is a clean concept which I like
> very much. I have a use case for putting multiple namespaces into one
> file, though.
>
> OOP-PHP applications are usually one class per file with conditional
> loading. This does not play well with caching. I am working on gluing
> together all files of a project into one large source file on deployment
> (a phing task will do this) so it can be opcode cached as one large
> application binary. I will then compare the performance of both
> apporaches, but I have a feeling that the "single binary" approach will
> be faster. As APC will be part of PHP6, I think this approach could
> improve general performance of PHP applications and easw deployment.
Note that what you are saving by combining the files into one is just a
single stat syscall per file. And that can be alleviated by setting
apc.stat=0 in your config. That of course means you need to restart
your server or flush your cache whenever you want to update the files.
In apc.stat=0 mode you gain nothing by merging all the files.
-Rasmus