Ver Mensaje Individual
  #11 (permalink)  
Antiguo 30/01/2010, 22:32
Avatar de unreal4u
unreal4u
 
Fecha de Ingreso: octubre-2008
Mensajes: 72
Antigüedad: 15 años, 6 meses
Puntos: 10
Respuesta: Rendimiento con APC

PD: Hice unas búsquedas en Google y me encontré con esto:

Código code:
Ver original
  1. <arnaud_> does autoload have a performance impact when using apc ?
  2. <Rasmus_> it is slow both with and without apc
  3. <Rasmus_> but yes, moreso with apc because anything that is autoloaded is pushed down into the executor
  4. <Rasmus_> so nothing can be cached
  5. <Rasmus_> the script itself is cached of course, but no functions or classes
  6. <Rasmus_> Well, there is no way around that
  7. <Rasmus_> autoload is runtime dependent
  8. <Rasmus_> we have no idea if any autoloaded class should be loaded until the script is executed
  9. <Rasmus_> top-level clean deps would speed things up a lot
  10. <Rasmus_> it's not just autoload
  11. <Rasmus_> it is any sort of class or function declaration that depends on some runtime context
  12. <Rasmus_> if(cond) function foo...
  13. <Rasmus_> if(cond) include file
  14. <Rasmus_> where file has functions and classes
  15. <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 original
  1. To clarify, of course conditionally included files get compiled and
  2. cached.  The issue is not the included files but the resulting
  3. conditionally defined classes and functions needing to be redefined on
  4. every request.  Whether that is significant or not comes down to the
  5. specifics of the situation, but there is no doubt that it is slower.  It
  6. comes down to a NOP vs. a FETCH_CLASS, for example and the NOP is
  7. obviously way faster.
  8.  
  9. -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 !!