PD: Hice unas búsquedas en Google y me encontré con esto:
Código code:
Ver original<arnaud_> does autoload have a performance impact when using apc ?
<Rasmus_> it is slow both with and without apc
<Rasmus_> but yes, moreso with apc because anything that is autoloaded is pushed down into the executor
<Rasmus_> so nothing can be cached
<Rasmus_> the script itself is cached of course, but no functions or classes
<Rasmus_> Well, there is no way around that
<Rasmus_> autoload is runtime dependent
<Rasmus_> we have no idea if any autoloaded class should be loaded until the script is executed
<Rasmus_> top-level clean deps would speed things up a lot
<Rasmus_> it's not just autoload
<Rasmus_> it is any sort of class or function declaration that depends on some runtime context
<Rasmus_> if(cond) function foo...
<Rasmus_> if(cond) include file
<Rasmus_> where file has functions and classes
<Rasmus_> or heaven forbid: function foo() { class bar { } }
Básicamente, Rasmus dice que siempre autoload va a ser lento, con o sin APC, pero que con APC la class que se carga automáticamente no se incorpora a la caché interna.
Solución para esto no hay, debido a que autoload está en tiempo de ejecución y que es variable, lo mismo corre para las condicionales: es más rápido para APC cargar todos los archivos una vez que ir cargándolas a medida que las vaya necesitando.
Interesante descubrimiento :) Por otro lado, incorporar todas las class es lento, innecesario y poco práctico, y al respecto tb encontré esto:
Código code:
Ver originalTo clarify, of course conditionally included files get compiled and
cached. The issue is not the included files but the resulting
conditionally defined classes and functions needing to be redefined on
every request. Whether that is significant or not comes down to the
specifics of the situation, but there is no doubt that it is slower. It
comes down to a NOP vs. a FETCH_CLASS, for example and the NOP is
obviously way faster.
-Rasmus
Según de lo que entiendo, esto contradice lo anterior xDDD
Fuentes:
http://bugs.php.net/bug.php?id=42683 http://pooteeweet.org/blog/538 http://marc.info/?l=pecl-dev&m=116512075914909&w=2
Saludos !!