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
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
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
Share on other sites

Oh! Looking back, that makes complete sense. I must have completely misread those quotes; silly of me.

 

My bad and sorry for wasting your time! And thanks!

 

@Yesideez ;D hehe

 

Cheers

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.