Hi Julien,

Julien Pauli wrote:
> Hi all.
> Darby's code to manage exception is a good deal, unfortunatly it seems
> to show performance issues.

Are you referring to the latest SVN? I think probably not.

http://framework.zend.com/fisheye/browse/~raw,r=7726/Zend_Framework/trunk/library/Zend/Loader.php

I think that the issues with performance of the error handling code I
had previously added have been resolved, since I removed the error
handling, but if you have trouble with the latest Zend_Loader's
performance, please provide us with your experience (metrics are
helpful, too :) ).

> What do you think of that new Zend_Loader code, working with php's
> track_error param ? :

Not a bad idea, but actually, I don't want to throw an exception when,
for example, an E_WARNING occurs in user code. Unless I'm decidedly
wrong about this (it's happened before ;) ), I think it's best to let
PHP handle such events in the normal PHP way, which is how the current
implementation operates.

Thank you kindly for your support! :)

Best regards,
Darby

> <?php
> //......
>         /**
>          * Try finding for the plain filename in the include_path.
>          */
>         if(ini_get('track_errors') == 0){
>             ini_set('track_errors',1);
>            }
>         if ($once) {
>             @include_once $filename;
>         } else {
>             @include $filename;
>         }
> 
>         /**
>          * If searching in directories, reset include_path
>          */
>         if ($incPath) {
>             set_include_path($incPath);
>         }
> 
>         if (isset($php_errormsg)){
>                 throw new Zend_Loader_Exception($php_errormsg);
>         }
> 
>         return true;
> // ..........
> ?>
> 
> cheers
> Julien.Pauli
> 
> 
> 
> 
> 2008/2/1, Darby Felton <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
> 
>     Ralf Eggert wrote:
>     >> As to your performance problems, I suspect that you could be having
>     >> trouble with Zend_Loader. Please see the following JIRA issue if you
>     >> also suspect the same could be true:
>     >>
>     >> http://framework.zend.com/issues/browse/ZF-2463
>     >
>     > But could this problem really result in a quadruplication of the run
>     > time for almost all pages? I rather thought that amendments to other
>     > components like Zend_Db or Zend_Controller might have caused the
>     > performance decrease.
> 
>     I probably should not guess any further. :) I'll recommend to use
>     profiling to determine the cause(s) of your performance degradation. :)
> 
>     I just happened to be aware (having made the changes myself) of a
>     not-so-fast Zend_Loader implementation pursuant to:
> 
>     http://framework.zend.com/issues/browse/ZF-2463
> 
>     This implementation made it into 1.5.0 PR before I could change it, but
>     the latest SVN version of it does not have the error handling functions
>     about which I was concerned. Instead, errors in included files will
>     simply be handled in the normal PHP way. :)
> 
>     >> Finally, I would recommend that Zend_Loader be eschewed, in favor of
>     >> using require_once, whenever possible. If there are any framework
>     >> components using Zend_Loader, where require_once would work nicely
>     >> instead, please let us know about it.
>     >
>     > This is not so easy to accomplish since my whole application relies on
>     > Zend_Loader. All classes I use should be loaded by Zend_Loader and I
>     > don't really get the point of a Zend_Loader class if it is not
>     > recommended to use it
> 
>     Okay, so in this case, it's not reasonably possible for you not to use
>     Zend_Loader. That's fine. I was really more concerned about the version
>     that came with 1.5.0 PR than the version from 1.0.3 or the version that
>     will be in 1.5.0 RC1.
> 
>     Best regards,
>     Darby
> 
> 

Reply via email to