-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

I think the key issue here is 'taking full advantage of opcaches'. From
what I have read[1] autoload will work with an opcache however it will
not be as fast as a script that does a number of require calls to static
filenames.

Now I assume that a lot of people are using the Zend framework for the
single point of entry MVC stuff which by its very nature requires
variable class declarations and therefore can not take full advantage of
an opcache either so what difference does it make if you use autoload or
not?

I think the real issue is the ease of use and development and not can
xyz take full advantage of an opcache. The choice should be there for
the developer to choose which route they would like to take, autoload or
require, after all its their application let them set it up however they
want.

Maybe the best solution is to keep the require_once calls in the Zend
framework files so that they can take full advantage of an opcode cache
 but also provide the developer with an autoloader that can be used if
they so desire, therefore giving freedom to the application developer.

<?php
// Load deps.
require_once 'Zend/Aaa.php';
require_once 'Zend/Bbb.php';
require_once 'Zend/Ccc.php';
require_once 'Zend/Ddd.php';
// do application stuff...
?>

        Vs.

<?php
// Load deps.
require_once 'Zend/ClassLoader.php';
Zend_ClassLoader::getInstance();
// do application stuff.
?>




[1] http://marc.theaimsgroup.com/?l=pecl-dev&m=116512075914909&w=2


Richard Thomas wrote:
> Ok, so here is the thing, while autoloading might be cool and fun it
> doesn't work with OpCaches...
> 
> Let me rephrase that, Your code will work but you will not see the
> full use of the opcache, this has been discussed in detail on the pear
> mailing lists and a couple other places.
> 
> Basically when you load any file using a variable as the target an
> opcache can not cache that file fully because it has no idea or not if
> the next request is going to be the same file.
> 
> If you want to take full advantage of opcaches from my understanding
> of the discussion you have to do
> 
> require('pathtofile'); OR require(CONSTANT_BASE_PATH.'restofpath');
> 
> If any non constant value is used an opcache will not cache fully, If
> your "constant" can change each page load you might run into errors.
> 
> 
> Now granted this is just what I gather from the stuff I have read over
> the last 2 months, I trying to put together a good benchmark to see
> whats the story is IRL.
> 

- --

Regards,

    William Bailey.
    Pro-Net Internet Services Ltd.
    http://www.pro-net.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFFo8ZvzSfrYDJMXmERAxbhAJ9WAQXnrHP9iHaDaTU4CqbUYlDmZQCfVHKx
duwZBFl+EU0146sek2psrK8=
=0GGR
-----END PGP SIGNATURE-----

Reply via email to