Jump to content

[SOLVED] APC & Autoload


Guest

Recommended Posts

So I've read that autoloading classes negates the benefits of opcode caching solutions (like APC, because the importing is done in runtime) -- but what I couldn't figure out is, to what degree?

 

If I were to rely entirely on autoloading (all classes and their internal dependencies), I assume caching solutions will be completely useless. But what if I were to manually require/include their dependencies, and only have the main classes themselves autoloaded; would the dependencies be cached?

 

Or perhaps there are ways around this? I'm right now looking into the SPL autoloader.

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/136907-solved-apc-autoload/
Share on other sites

I don't know where you've been reading this, but autoloading and opcode cacheing aren't related in that way.

 

 

Opcode cacheing simply means that the PHP files that you load are compiled into cache, so the next time you load them (whether using include, require, autoload, or whatever) they are already complied in the cache.

 

include, require and autoload simply tell php what files it needs to compile

Link to comment
https://forums.phpfreaks.com/topic/136907-solved-apc-autoload/#findComment-715088
Share on other sites

Well reading those two articles, any issues don't seem to relate directly to autoload and apc:

you still get the majority of the bytecode cache benefit which is that you don’t need to re-read the file, do lexical analysis and run a parser on it the code…
and
To clarify, of course conditionally included files get compiled and cached. The issue is not the included files

 

It all seems to revolve around conditionally defined classes and functions.

Link to comment
https://forums.phpfreaks.com/topic/136907-solved-apc-autoload/#findComment-715108
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.