Hi Nico,

On Sat, 2007-12-15 at 16:54 +0100, Nico Edtinger wrote:
> Shahar Evron wrote:
> > 10 redundant include files have quite an impact on performance,
> > especially in places where you have no opcode cache installed.
> 
> If you don't have an opcode cache you simply don't care about  
> performance. So why should we optimize for these people? 

That's not true - some people (actually much more than "some") run in
shared hosting environments where they have no control on what PHP
extensions are installed. 

Also, IMHO we build a framework, and it should be used by *users* who
*do not need to care* about much. The whole essence of frameworks is
like saying "I'll take care of this issue for you, so you don't have to
care about that". 

Besides, even when you have opcode cache, requiring exception classes
which are *never* used in normal situations (that's why it's an
*exception*) has it's overhead on both performance and memory usage.
Zend Framework is not a lightweight addition to any app - and whatever
we can reduce should be reduced (again, not saying it's top priority,
but we should keep it in mind IMHO). 

> and future PHP versions have APC bundled.

That should be "will have", in god knows how much time. PHP 6.0 is *at
least* a year away, and I think that's an understatement. 

> The suggested optimization can be
> a) something like we did before - one central method, which didn't  
> work so well

As said, that didn't work very well.

> b) repeated every time we need to throw an exception, which is bad  
> practice and bad for readability

While I wish there was a better solution, it's not that bad IMHO. One
extra line of code per "throw" call for us is a small price to pay for
the overhead of loading almost-never used classes into memory.
Personally I don't think it has any effect on readability. 

> 
> IMO the best solution is a big banner "USE AN OPCODE CACHE IF YOU CARE  
> ABOUT PERFORMANCE".
> 

Opcode cache does not solve all problems yet. Also, as I said before,
not all people can use opcode cache. 

Shahar.

> nico 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to